Re:Show HN: A fast JSON library for Go
by 0x008 on Tuesday February 09, 2021 @07:41AM
(#26076780)
As a Non-Gopher, is the stdlib so slow?
[ Parent
| on HN ]
I think it depends on the application. In many cases, encoding/json is fast enough and stable, but I think you can try to use a faster library if JSON encoding / decoding is performance critical on your application.
Or you could try something like Apache Arrow or Flexbuffers?
If you write off the "JSON", sure, there's a bajillion options. But that's not always possible or desirable. None of those bajillion options have the combination of support and mindshare that JSON has obtained, for better or worse.
Re:Show HN: A fast JSON library for Go
by fredrikholm on Tuesday February 09, 2021 @09:10AM
(#26077605)
We're talking differences of a thousandth of a millisecond (0.001ms) for most structs, but yes.
encoding/json from stdlib makes a lot of allocations (~30) due its use of reflection, which is notoriously slow.