News for hackers. Stuff that matters.
Re:Show HN: A fast JSON library for Go by goccy on Monday February 08, 2021 @07:58AM (#26063831)
I develop a super fast JSON library ( https://github.com/goccy/go-json ) . It is drop-in replacement of encoding/json.

This library is available by simply replacing the import statement. It's more compatible and much faster than json-iterator/go.

Please give me your feedback ! Thanks !

Re:Show HN: A fast JSON library for Go by krenel on Tuesday February 09, 2021 @05:37AM (#26075895)
Hi mate,

very interesting library. Keep it up.

Improvement suggestion: While reading the README, the JSON library comparison [1] it's confusing, at least to me. It uses symbols like: ○, and △ which are not obvious. I would rather use "yes/no" or the classic check/x (unicode chars, HN does not support them here) if you want to use symbols. I don't know what "△" even means, so I cannot suggest an alternative.

Just my 2 cents.

[1]: https://github.com/goccy/go-json#json-library-comparison

Edit: This 2021 I have the objective to contribute more to OS projects. Is it OKay if I submit a PR with the change? Thanks!

Re:Show HN: A fast JSON library for Go by YesThatTom2 on Tuesday February 09, 2021 @07:08AM (#26076553)
Another suggestion in the chart: it isn't obvious which line is about your project because it doesnt list the `goccy/` part. I would add that and move it to the top, out it and the standard in bold.
Re:Show HN: A fast JSON library for Go by goccy on Tuesday February 09, 2021 @09:14AM (#26077661)
Yes, Of course !! Welcome !!
Re:Show HN: A fast JSON library for Go by krylon on Tuesday February 09, 2021 @08:09AM (#26077031)
How does it handle de-serializing to structs with interface members? With encoding/json and ffjson, I had to write some code to handle that myself and add a type-tag member to my struct, which wasn't a deal-breaker, but if I could avoid that, I would like that very much.
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.