incr
ossIncremental computation engine for Rust. Tracks dependencies between computations automatically and only reruns what's actually affected.
Most software recomputes everything from scratch whenever anything changes. Your CI rebuilds the whole project when you edit one file, your dashboard re-queries the whole database when one row updates. There are domain-specific fixes for this (React diffs the DOM, Salsa caches compiler queries, Materialize does incremental SQL) but if you just want to make your own code incremental, theres nothing to reach for.
incr is a crack at solving that. It’s a Rust library (with Python bindings on the roadmap) that tracks dependencies between computations automatically and only reruns what’s actually affected by a change. The engine lives in incr-core and is parameterized over a concurrency strategy; two surface crates expose it: incr-compute (Local strategy, single-threaded, zero atomic-fence cost) and incr-concurrent (Shared strategy, Send + Sync, lock-free reads). Same public API, one-line dependency swap.
The compiler monomorphizes both paths from the same source, so neither crate subsidizes the other: single-threaded users pay no atomic-fence cost; concurrent users pay no extra indirection for the lock-free read path.
Numbers
- 100–236× faster for incremental collection inserts vs from-scratch recomputation
- ~135 ns/node propagation through function DAGs
- Nine collection operators:
filter,map,count,reduce,sort_by_key,pairwise,window,group_by,join
License: Apache-2.0.