Re:Show HN: Gojay – Performant JSON encoder/decoder for Golang
by mintcrate on Sunday May 20, 2018 @05:12PM
(#17114755)
That project is not an encoder/decoder - it just returns values of keys. They are not comparable as the use cases are entirely different.
[ Parent
| on HN ]
Re:Show HN: Gojay – Performant JSON encoder/decoder for Golang
by nieksand on Sunday May 20, 2018 @06:53PM
(#17115180)
When it comes to parsing JSON, they are indeed not doing the same thing. Buger's parser is not unmarshalling into an annotated struct.
But often that struct isn't your end goal in life, such as when your data is being transformed, dispatched on, or being moved into another yet data structure. In that case unmarshalling to an intermediate structure, while convenient, is also extra computational work.
Buger's parser isn't the first thing I'd reach for, but if JSON parsing performance is an issue, ObjectEach() can be used in many places where you'd otherwise invoke json.Unmarshal.
Re:Show HN: Gojay – Performant JSON encoder/decoder for Golang
by alex_dev on Sunday May 20, 2018 @08:26PM
(#17115460)
Hence why the above poster said different use cases and why comparing between them is ridiculous. Using ObjectEach() for every field to reach parity with json.Unmarshal is unconscionable.