Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

OffHeap – An off-heap L1 cache engine for Node.js written in Rust

OffHeap is a high-performance off-heap L1 cache engine for Node.js, written in Rust. It provides caching outside the Node.js heap to reduce garbage collection pressure and improve performance for data-intensive applications.

Background

OffHeap is a new open-source caching engine for Node.js built in Rust. It stores data "off-heap" — outside the JavaScript memory heap managed by Node/V8 — avoiding garbage-collection pauses that can slow latency-sensitive apps. The project targets developers using Node.js (especially with Express/Next.js backends) who need an L1 cache that stays fast under load. It competes with in-process solutions like Node's native `Map` or libraries such as `node-cache` and `lru-cache`, which all live inside V8's heap and trigger GC. By moving cache storage to Rust (via the FFI/binding layer), OffHeap claims to keep memory usage more predictable. The author, Michael Dwyer (mdwyer), published it as an MIT-licensed Rust crate plus NPM package. The README highlights a 10–100× throughput improvement over comparable JS caches in early benchmarks. Because it's an L1 cache, it's meant to sit closest to the app process (e.g., in-memory), as opposed to L2 caches like Redis or Memcached which run as separate processes.

Related stories