Tags: wudi/jsonx
Tags
jsonx v0.1.0 — first release
Drop-in `encoding/json` replacement with AVX-512BW (amd64) and NEON
(arm64) accelerated kernels. Decoder + encoder are both faster than
`bytedance/sonic` on every measured gate of the standard corpus.
Highlights (EPYC-Genoa AVX-512BW, 5s × count≥2 benchmarks):
Decode interface{} — +10 % to +63 % over sonic on small / twitter /
citm_catalog / canada / 1-5-10 MB deeply-formatted payloads.
Decode struct — +50 % to +88 % over sonic on the same corpora
(1 MB formatted: 1499 MB/s vs sonic's 797 MB/s).
Encode interface{} — +11 % to +52 % over sonic across every
corpus after the Schubfach formatter + amd64 digit-emission asm
kernel work.
ARM64 (Ampere Altra / Neoverse-N1): struct decode +26 %-+65 %
over sonic; 1 MB deep-struct 789 MB/s vs sonic's 627 MB/s.
Architecture:
- Type-specialized decoder plan cache (no reflect after warmup).
- Slab allocators for interface{} scalar boxes + slice headers.
- SWAR fast-paths on string scan, whitespace skip, number parse.
- Single-compare whitespace kernel (VPCMPUB on amd64, CMHI on
arm64) exploiting JSON's grammar: any structural-position byte
≤ 0x20 is whitespace or malformed.
- Schubfach float formatter (pure Go, arch-agnostic); Eisel-Lemire
decoder fed directly from the mantissa scan.
- Encoder: one allocation per call; pre-quoted struct keys.
Full scorecard, experiment log, and reproducer benchmarks are in
RESULTS.md and README.md.
Requires Go 1.22+. No CGO.