Arena-based parsers

This micro-book delves into parsers, memory allocations, and arenas. Written in Rust, the parser decodes Ruby code, boasting a remarkable 2x speed improvement from 37MB/s to 80MB/s by eliminating heap allocations and storing parsed data exclusively in the arena. The innovative approach allows for quick writing of parsed data to disk and easy retrieval through mmap, simplifying AST caching. While the code is labeled as “experimental” and not for release, interested individuals can explore the arena-fixes branch with the –features=development flag enabled. The project serves as an intriguing experiment to assess the viability of such optimizations, suggesting those in need of a Ruby parser consider utilizing prism with Rust bindings on crates.io.

https://iliabylich.github.io/arena-based-parsers/

To top