.. /index

bumpalo

bumpalo

bumpalo provides bump allocation in Rust — ~2 ns per allocation with instant bulk deallocation. It's ideal for phase-oriented work where you allocate many objects, process them, then discard everything at once (parse -> process -> discard).

How it works

A bump allocator maintains a single pointer into a pre-allocated region. Each allocation just advances the pointer — no free lists, no metadata per allocation. Deallocation happens all at once when the arena is dropped or reset. This makes individual allocations nearly free but means you can't free individual objects.

Related arena crates

Arena/bump allocators deliver 2–5x speedup over general malloc for batch allocations (LLVM's BumpPtrAllocator, Rust's bumpalo). Combined with mimalloc as the global allocator, this covers the full allocation performance spectrum. See soa-vs-aos and ecs-pattern for how memory layout optimization compounds with allocation optimization.

Linked from

Sources