News for hackers. Stuff that matters.
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?
Re:Show HN: A fast JSON library for Go by goccy on Tuesday February 09, 2021 @09:02AM (#26077520)
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.
Re:Show HN: A fast JSON library for Go by 0x008 on Tuesday February 09, 2021 @09:14AM (#26077654)
Or you could try something like Apache Arrow or Flexbuffers?
Re:Show HN: A fast JSON library for Go by jerf on Tuesday February 09, 2021 @09:44AM (#26078047)
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.