Skip to content

Release v1.2.1: Zero-Alloc Async Streaming & Nested Struct Slices

Choose a tag to compare

@GenshIv GenshIv released this 28 Jun 16:48

This release introduces major architectural improvements to stream parsing, making it incredibly powerful for high-throughput backend applications, along with enhanced structural support.

✨ New Features
Async Producer-Consumer Streaming (NextChan) We've introduced dec.NextChan(bufferSize int), a new asynchronous channel-based iterator! You can now parse infinite JSON streams on a background goroutine while your main thread processes the data concurrently.
Zero Extra Allocations: Unlike traditional libraries that suffer from massive allocations or data races when passing structs to channels, SilentJSON utilizes a highly optimized internal Ring Buffer. It reuses memory safely, keeping memory allocation locked at the exact same minimal footprint as synchronous iteration (only ~41MB under extreme load).
Throughput: Achieves ~378 MB/s with practically zero GC pressure.
Support for Nested Struct Slices Added full parsing support for []Struct types. The decoder now seamlessly handles nested arrays of complex objects using dynamic registry traversal, allowing for much deeper and richer Go struct bindings out-of-the-box.
📈 Benchmarks Update
We have updated our internal benchmarks and the README.md to include visually stunning Mermaid charts comparing streaming performance. SilentJSON now officially dominates the stream-parsing landscape in both speed and memory efficiency compared to jsoniter and the standard library.

🛠 Fixes & Improvements
Fixed an issue where nested array structures were not properly mapped during BuildRegistry.
Prevented critical data-races in channel streaming by properly sizing the ring buffer relative to the channel capacity (bufferSize + 4).