A fast, configurable JSON encoder for Go with 100% compatibility to encoding/json and no dynamic allocations in hot paths.
Jettison is a high-performance JSON encoder for Go that provides full compatibility with the standard encoding/json package while offering significant speed improvements and rich configuration options. It avoids runtime reflection by using pre-built instruction sets, making it ideal for high-throughput applications.
Go developers building high-performance applications that require efficient JSON marshaling, such as web servers, APIs, or data processing pipelines where JSON serialization is a bottleneck.
Developers choose Jettison because it combines the familiar API and reliability of Go's standard JSON package with faster performance, zero allocations in hot paths, and extensive configuration options without requiring code generation.
Highly configurable, fast JSON encoder for Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks show Jettison outperforms encoding/json and alternatives like jsoniter, with speeds up to 144MB/s in complex scenarios, making it ideal for high-throughput applications.
Eliminates dynamic memory allocations during marshaling, reducing GC pressure, as evidenced by lower alloc/op in benchmarks for maps and complex types.
Aims for 100% compatibility with encoding/json, allowing seamless replacement with the same API and struct tags, backed by an extensive test suite comparing outputs.
Offers functional options like TimeLayout, DurationFormat, and UnsortedMap, providing fine-grained control over JSON encoding without breaking standard behavior.
Jettison focuses solely on JSON encoding, so projects needing decoding must use another library, potentially complicating the codebase with mixed marshaling strategies.
Requires Go 1.17 or higher, locking out teams on older versions and delaying adoption in legacy systems, as stated in the installation notes.
Avoids runtime reflection by generating instruction sets per type ahead of time, which can add initialization cost for applications with many diverse or rarely used types.