jzon-rs
Zero-copy JSON for Rust with compile-time generated parsers.
Quick Start
[]
= "0.1"
use ;
Highlights
- Zero-copy —
&'a strfields borrow directly from the input; no heap allocation for string data. - SIMD scanning — uses vectorised byte-search on x86-64 and aarch64 for structural character detection.
- No
unsafein user code — the derive macros emit fully safe Rust. - serde attribute compatibility —
#[serde(rename = "…")],#[serde(skip_serializing_if)], etc. are honoured by the derive macros.
Performance
Benchmarked on Apple M2, rustc 1.78, release mode, criterion 0.5.
| Dataset | jzon | serde_json | sonic-rs |
|---|---|---|---|
| twitter de | ★ 316 µs | 327 µs | 345 µs |
| canada de | ★ 2.43 ms | 3.51 ms | 3.03 ms |
micro Point de |
★ 41 ns | 74 ns | 63 ns |
Other Crates
| Crate | Purpose |
|---|---|
jzon-rs-serde |
SIMD-backed serde Serializer/Deserializer for any serde-deriving type |
jzon-rs-compat |
Drop-in serde_json replacement via Cargo's [patch] mechanism |
License
MIT
Made with ❤️ by Rajaniraiyn