Re:Flattening ASTs (and Other Compiler Data Structures)
by comonoid on Sunday July 02, 2023 @12:05PM
(#36562771)
Can be mitigated by a rope(?) structure (i.e. the vector is split into chunks of fixed size, no re-allocation required) with real pointers. It will be unsafe inside, but safe (read-only) interface seems to be possible.
Deallocation will be O(n), but still much faster than a tree.
Deallocation will be O(n), but still much faster than a tree.