Stumpalo is a new bump allocator for Rust that outperforms existing alternatives like bumpalo and blink across most allocation benchmarks. Its speed comes from leveraging compile-time type information (alignment, size) to eliminate unnecessary checks, reducing the fast path to as few as six instructions with a single conditional branch, and storing top/bottom chunk pointers directly in the arena struct to avoid an extra layer of indirection. It also supports scoped stacks, allowing temporary arena usage with automatic revert and chunk reuse via a free list, with a safe API enforced at compile time.

6m read timeFrom owen.cafe
Post cover image
Table of contents
# Speed# Scoped stacks
206 Impressions