← Back to the 2026 landscape
Compare

fast-langgraph vs orjson: 737× vs 2-5× for LangGraph checkpoint serialization

orjson accelerates Python's json module by 2-5× using Rust internally. fast-langgraph goes further: it bypasses Python object allocation entirely, parallelises across Rust threads, and adds batched SQLite writes — 737× faster for LangGraph checkpoints.

Install
$ pip install fast-langgraph
TL;DR

fast-langgraph is a Rust-backed drop-in for orjson. Same API, faster hot paths. Install: pip install fast-langgraph. 737× faster checkpoint serialization (0.1ms vs 73.5ms).

fast-langgraph vs orjson: the facts

fast-langgraph

737× faster checkpoint serialization (0.1ms vs 73.5ms).

orjson

2-5× faster than Python json.dumps (Rust-backed but still allocates Python objects).

fast-langgraph

Bypasses Python object allocation entirely (reads state directly from Python memory).

orjson

Still traverses the Python object tree; only the final byte serialization is in Rust.

fast-langgraph

Parallelises across Rust threads (no GIL contention).

orjson

Single-threaded; the GIL is held during the Python-side traversal.

fast-langgraph

Batched WAL writes to SQLite; no per-checkpoint fsync.

orjson

orjson is a serializer, not a storage layer — you still need your own SQLite integration.

fast-langgraph

Drop-in for LangGraph (auto-patch or RustSQLiteCheckpointer).

orjson

Drop-in for json.dumps — you wire it into LangGraph yourself.

fast-langgraph

MIT licensed.

orjson

MIT licensed.

Benchmarks

Reproduction instructions in the project README. Numbers measured on AMD Ryzen 9 7950X, 64GB DDR5, NVMe SSD, Python 3.12.

Metric fast-langgraph orjson
Checkpoint serialization (50-msg state) 0.1ms ~15-30ms (estimated)
Checkpoint deserialization 0.3ms ~10-20ms (estimated)
Full state update (serialize + write + read) 2.0ms N/A (orjson does not include storage)

When to use fast-langgraph

  • You use LangGraph and checkpoint serialization is your bottleneck.
  • You want the storage layer (batched WAL writes) as well as the serializer.
  • You want a drop-in that patches LangGraph automatically.

When NOT to use fast-langgraph

  • You only need a faster json.dumps for a non-LangGraph use case — use orjson directly.
  • You want to keep your existing checkpointer and just swap the serializer — orjson + manual integration is lighter.

Frequently asked questions

Does fast-langgraph use orjson internally?

No. fast-langgraph uses Rust's serde + simd-json directly, bypassing Python object allocation entirely. orjson still traverses the Python object tree (in Python) before serializing to bytes (in Rust). fast-langgraph reads the state directly from Python's memory and writes JSON bytes without intermediate Python objects.

Can I use orjson and fast-langgraph together?

You can, but there's no benefit. fast-langgraph replaces the entire serialization + storage path; orjson would only be used if fast-langgraph falls back to the original Python implementation due to a version mismatch.

Why is fast-langgraph 737× faster when orjson is only 2-5× faster?

Three reasons: (1) fast-langgraph bypasses Python object allocation — orjson still allocates Python objects for every value in the state tree. (2) fast-langgraph parallelises across Rust threads — orjson is single-threaded. (3) fast-langgraph includes batched SQLite WAL writes — orjson is only a serializer, not a storage layer.