#serde-json #memory #replace #interning #string #feldera #ijson

feldera-ijson

A more memory efficient replacement for serde_json::Value

1 unstable release

0.1.4 Aug 29, 2024

#668 in Encoding

Download history 382/week @ 2024-08-28 414/week @ 2024-09-04 484/week @ 2024-09-11 590/week @ 2024-09-18 274/week @ 2024-09-25 186/week @ 2024-10-02 237/week @ 2024-10-09 170/week @ 2024-10-16 279/week @ 2024-10-23 166/week @ 2024-10-30 142/week @ 2024-11-06 183/week @ 2024-11-13 135/week @ 2024-11-20 209/week @ 2024-11-27 208/week @ 2024-12-04

748 downloads per month
Used in dbsp

MIT/Apache

555KB
5K SLoC

ijson

This is a temporary fork of ijson for feldera while waiting for upstream patches to be submitted and merged. Do not use.


lib.rs:

This crate offers a replacement for serde-json's Value type, which is significantly more memory efficient.

As a ballpark figure, it will typically use half as much memory as serde-json when deserializing a value and the memory footprint of cloning a value is more than 7x smaller.

The primary type exposed by this crate is the IValue type. It is guaranteed to be pointer-sized and has a niche (so Option<IValue> is also guaranteed to be pointer-sized).

Cargo features:

  • ctor A global string cache is used when interning strings. This cache is normally initialized lazily on first use. Enabling the ctor feature will cause it to be eagerly initialized on startup. There is no performance benefit to this, but it can help avoid false positives from tools like mockalloc which try to detect memory leaks during tests.

Dependencies

~5–10MB
~119K SLoC