You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My need is to transfer large objects between golang and v8. Usually it has a size of 1M (after Json serialization). I tested using v8.JSONParse() and it will take about 4ms (for 1M json). Is there any way to improve the transfer performance?
// 18,634 ns/op// On the contrary, it is slower. I guess it is because c needs to be called multiple times.funcBenchmarkToValueSample(b*testing.B) {
v:=map[string]interface{}{}
json.Unmarshal([]byte(sampleData), &v)
ctx:=v8.NewContext()
ot:=v8.NewObjectTemplate(ctx.Isolate())
b.ResetTimer()
fori:=0; i<b.N; i++ {
toValue(ctx.Isolate(), ot, ctx, v)
}
}
Is there any way to improve the transfer performance?
I don't know much about cgo vs v8, maybe I'm missing some available API?
The text was updated successfully, but these errors were encountered:
My need is to transfer large objects between golang and v8. Usually it has a size of 1M (after Json serialization). I tested using
v8.JSONParse()
and it will take about 4ms (for 1M json). Is there any way to improve the transfer performance?Here are some simpler examples and what I tried:
Next I tried initializing the value directly using the v8 api instead of serialization
Is there any way to improve the transfer performance?
I don't know much about cgo vs v8, maybe I'm missing some available API?
The text was updated successfully, but these errors were encountered: