[Library] Tachyon JSON v6: 5.5 GB/s parser in ~750 lines of C++20/AVX2. Faster than simdjson OnDemand?
Hi r/cpp,
I’ve spent the last few months working on Tachyon JSON v6, a header-only library designed for one thing: maximum possible throughput on x86_64 without sacrificing the "nlohmann-like" ease of use.
Why another JSON library?
I wanted the convenience of j["key"].get<int>() but with the raw power of handwritten ASM/SIMD kernels. Tachyon uses a Lazy Indexing architecture—it doesn't build a costly DOM tree. Instead, it generates a structural bitmask using AVX2 and only materializes values on demand.
Benchmarks (Xeon Haswell):
Large Array (25MB): 4,577 MB/s (vs 1,886 MB/s for simdjson OnDemand).
Canada.json (Floats): 5,585 MB/s (Optimized via custom branchless float kernels).
General Performance: Up to 160x faster than nlohmann/json and ~30x faster than Glaze in generic mode.
Technical Specs:
SIMD Optimized: Core logic is built around _mm256_shuffle_epi8 (PSHUFB) and _mm256_movemask_epi8.
Branchless: Structural parsing is almost entirely branchless to avoid CPU pipeline stalls.
Lightweight: The entire core is ~750 lines of C++20.
Comments Support: Built-in support for // and /* */ comments without performance penalty.
License: Proprietary Source License (Free to use, but core ASM kernels are protected).
I’d love to hear your thoughts on the lazy navigation logic and the structural indexing implementation!
GitHub: https://github.com/wilkolbrzym-coder/Tachyon.JSON
https://redd.it/1q3x5nq
@r_cpp
Post #24638
26