Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
What version of Go are you using (
Why is the encoding/decoding performance of maps important here? Usually, when one is decoding large amounts of data, structs are used.
It seems to me like gojay makes types like maps more efficient by adding more code to handle them especially. It's something we can consider, but it's a tradeoff. We don't want the standard library to get large in size, and hard to maintain.
Do you have a realistic piece of code where the peformance here is a problem, or is this simply about benchmarking different json libraries?
It looks like gojay avoids allocating by unsafely converting the byte input to a string.
This is not a condition encoding/json imposes on its callers, nor can it start. So this particular "optimization" ("bug" might be more likely) is not available.
Gojay also seems to be accidentally quadratic in its unescaping of strings, for what it's worth.
I'm not sure there's anything actionable in this issue.