You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Semantic's data structures seem like a good candidate for arena allocation - lots of small structures built in a short space of time and then dropped simultaneously (much like the AST itself).
Semantic<'a> already has a lifetime, so moving the data into arena would not affect ergonomics of API.
The one downside of the arena allocator is that Vecs never grow in place, they always reallocate and are copied when they grow beyond capacity, because bumpalo packs data tightly and grows downwards.
This problem could be largely ameliorated if:
Parser counts number of scopes, symbols and references during parsing.
Initialize ScopeTree's Vecs with required capacity at the start, so they never need to grow.
Additional benefits:
Storing semantic data in arena makes it available in JS via AST transfer (for building e.g. linter rules / transform plugins in JS).
Semantic
's data structures seem like a good candidate for arena allocation - lots of small structures built in a short space of time and then dropped simultaneously (much like the AST itself).Semantic<'a>
already has a lifetime, so moving the data into arena would not affect ergonomics of API.The one downside of the arena allocator is that
Vec
s never grow in place, they always reallocate and are copied when they grow beyond capacity, because bumpalo packs data tightly and grows downwards.This problem could be largely ameliorated if:
ScopeTree
'sVec
s with required capacity at the start, so they never need to grow.Additional benefits:
The text was updated successfully, but these errors were encountered: