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
While working on cache-related things, I found that it will be much more easier if we have a way to store some metadata in AST.
But metadata increase the size of the type, meaning that it will be less performant.
So I want to attach a type map (which uses downcasting using Any) to
Module
Script
Function
BlockStmt
I think it's the sweet spot. I can't explain the exact reason, but it's my guess based on my experience.
If you think another type also should have the metadata field or those should not, please tell me.
Also, I want to hear more about (potential) usecase.
Usecase
Caching
collect_decls was quite costly when I profiled it. But with this typed metadata API, it can cache data for each node instead of recalculating it every time.
Unresolved question
rkyv
I'm not sure how should we pass this, or preserve it while calling plugins.
(Note: We may not have any metadata prior to plugin invocation, and it's true in current model)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
While working on cache-related things, I found that it will be much more easier if we have a way to store some metadata in AST.
But metadata increase the size of the type, meaning that it will be less performant.
So I want to attach a type map (which uses downcasting using
Any
) toI think it's the sweet spot. I can't explain the exact reason, but it's my guess based on my experience.
If you think another type also should have the metadata field or those should not, please tell me.
Also, I want to hear more about (potential) usecase.
Usecase
Caching
collect_decls
was quite costly when I profiled it. But with this typed metadata API, it can cache data for each node instead of recalculating it every time.Unresolved question
rkyv
I'm not sure how should we pass this, or preserve it while calling plugins.
(Note: We may not have any metadata prior to plugin invocation, and it's true in current model)
Beta Was this translation helpful? Give feedback.
All reactions