unrolled / render

Go package for easily rendering JSON, XML, binary data, and HTML templates responses.
MIT License
1.94k stars 146 forks source link

replace encoding/json with segmentio/encoding #79

Closed rleungx closed 4 years ago

rleungx commented 4 years ago

This PR replaces encoding/json with segmentio/encoding. Here are the benchmarks from my own computer:

> benchcmp old.txt new.txt
benchmark                     old ns/op     new ns/op     delta
BenchmarkNormalJSON-40        1013          684           -32.48%
BenchmarkStreamingJSON-40     956           686           -28.24%
unrolled commented 4 years ago

Thanks for submitting the PR, but unfortunately this isn't a change I feel is needed. The goal of this package is to be a very simple rendering engine with little to no dependencies. I think if folks are worried about marshalling speeds, they wouldn't use this package and likely implement something more streamlined for their own unique needs.

rleungx commented 4 years ago

Got it, thanks.