You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initial commit
Torque is a high-performance JSON library for Elixir, backed by
sonic-rs (SIMD-accelerated) via Rustler NIFs.
Decoding:
- Full decode: parse entire JSON binary into Elixir terms in one pass
- Parse + Get: parse into opaque document reference, then extract
fields by JSON Pointer (RFC 6901) path — ideal for selective field
access (e.g. OpenRTB bid request processing)
- get_many/2: extract multiple fields in a single NIF call to minimize
NIF boundary crossings
Encoding:
- Direct term-walking encoder (no intermediate representation)
- Supports maps (atom/binary keys), lists, binaries, numbers, booleans,
nil, atoms, and jiffy-style {proplist} tuples
- encode_to_iodata/1 fast path returning raw binary for direct I/O use
Performance:
- sonic-rs SIMD-accelerated parsing and serialization
- Inputs >10 KB auto-dispatch to dirty CPU schedulers
- get/2 always runs on normal schedulers (sub-microsecond pointer traversal)
- Stack-allocated array for get_many up to 64 paths, heap fallback beyond
- Zero-allocation atom name reads via stack buffer in encoder
- itoa/ryu for fast integer/float formatting
Targets: aarch64-apple-darwin, aarch64-unknown-linux-gnu,
x86_64-apple-darwin, x86_64-unknown-linux-gnu (precompiled via
RustlerPrecompiled, TORQUE_BUILD=true for local source builds).