Faster alloc/free without lifetimes?
Hi. I'm the author of the SWC project. https://swc.rs/
It's an ECMAScript compiler, and I have performance problems with it. It holds AST nodes, and AST nodes are inherently recursive. And it holds many Box<T>s and Vec<T>s.
Currently, memory allocation and deallocation take a noticeable amount of time. So I'm considering using a crate like bumpalo, but it requires enormous amount of work because I have to add lifetimes to all AST nodes.
So, I want to know if there's an alternative way to improve performance in this case.
Are these traits exploitable in another way?
Dropimplementations of AST nodes have no side effects other than deallocating memory.- Single
Program(top-level AST node) is allocated almost linearly in the memory, while parsing.