> Would it complicate the parser much to allocate memory using a different
allocator? It's just a function call, presumably.
Is not the allocator per-se, is the fact that with the arena we can free
*all the memory* in one single call, instead of having to implement custom
free functions for the nodes or triggering a recursive chain of deallocations. The
parser itself owns all the memory block (by owning the arena) so we don't need
to add specific ownership models to the nodes, which makes the inner workings
much easier to organise, including temporary allocations.
> As for performance, we don't know how much difference it will make until
> Deallocation doesn't have to be recursive.
But if we model the nodes as Python objects with owership via attributes, it will be recursive because
it's a tree. You would need specific allocators to avoid it.