2026-04-23 16:54 UTC
New article on reducing #rust memory footprint
https://dystroy.org/blog/box-to-save-memory/
Feedback very welcome
Replies (1)
-
@Alonely0@mastodon.social 2026-04-23 17:10
@dystroy@mastodon.dystroy.org maybe consider using an arena or a bumper allocator like bumpalo? It helps greatly with cache locality and makes allocations as fast as they can get. I'm currently working on a language parser, and I'm using it to store all the data of the AST, which is recursively-dependant. If you just use a bumper, remember you will be leaking memory if you need to resize vectors after allocating something else, so you need to be able to predict sizes on most cases or use two or more in tandem.