HNHacker News
TopNewBestAskShowJobs

francoisllm

78 karma · joined May 7, 2018

submissionscomments
francoisllm··on Show HN: Gojay – Performant JSON encoder/decoder for Golang
It's actually the next milestone, a generator for structs, maps and slices. Until now the goal was to make it ready for some high traffic services in production. These traffic receive JSON with chinese, vietnamese character so we needed to make sure it works well first (boilerplate was not an issue).
francoisllm··on Show HN: Gojay – Performant JSON encoder/decoder for Golang
The next milestone is actually to write a code generator for structs, maps and slices.
francoisllm··on Made the fastest Golang JSON logger thanks to a pooling optimisation
Hey guys, wanted to share my experience.

I just updated onelog, my zero alloc JSON logger, and made it the fastest JSON logger out there by far, thanks to a simple `pooling optimisation` in gojay (the underlying JSON encoder).

Previously, I was using buffered channel in Gojay to pool encoders in memory. My logger was fast already, but zerolog or zap was a bit faster in some cases. I noticed through profiling, that sometime, it took time to acquire from channels and increasing the buffer size didnt chang.

Then I disabled pooling and noticed a good performance increase but more allocations. so I tried with sync.Pool, made a safe usage of it and performance of the logger have jumped 2x to 3x.

It is now by far the fastest JSON logger out there.