Arnold1
Arnold1
@kevburnsjr @valyala is there a way to make that code better/faster? I read Data from the json and need to re-write it: https://play.golang.org/p/PJY7bmj6U7Q I refer to the: ``` fastjson.Parse(fmt.Sprintf ......
is there a way to optimize setData by optimizing fastjson.Parse(fmt.Sprintf...? oh I see your link above now.
@kevburnsjr - why do you have 2 ```parserPool1 *fastjson.ParserPool``` and how long does ```fastjson.Arena{}``` need to be exist? - lets say I want o set more variables inside "Data". will...
hi @kevburnsjr did you see my reply?
@valyala oh, my bad. i need to do: ``` // mapping.data is []*fastjson.Value for _, val := range mapping.data { settings := getSettings(val.Get("Type")) if settings != nil { val.Set("ID", fastjson.MustParse("\""...
@valyala what happens if settings.ID is a int64 and i want the value to be an integer and not string? val.Set("ID", settings.ID)
@valyala before: ``` val.Set("ID", fastjson.MustParse("\""+strconv.FormatUint(settings.ID, 10)+"\"")) ``` how to use NewNumberInt here? how to use Arena for that? may i ask why uses arena compared to fastjson.MustParse? ``` val.Set("ID", fastjson.NewNumberInt(settings.ID))...
@valyala not sure how to use arena, its kinda strange to me... how to pass it to existing val.Set ?
can you also do that? ``` for _, val := range mapping.data { settings := getSettings(val.Get("Type")) if settings != nil { var a fastjson.Arena val.Set("ID", a.NewNumberInt(settings.ID)) val.Set("ID2", a.NewNumberString(settings.ID2)) } }...
do you suggest to define var pp fastjson.ParserPool and var ap fastjson.ArenaPool global? how many elements does it preallocate for fastjson.ArenaPool and fastjson.ArenaPool? dont you need to check if ap.Get()...