-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
We currently store all declarations and definitions in their respective maps, which is part of the reason why we need to use u64 rather than u32 for IDs.
I think we may be able to change that situation if we partition the maps. One example of how we might do it is:
constants: IdentityHashMap<ConstantId, Declaration>all constants including namespacesmethods: IdentityHashMap<MethodId, Declaration>all methodsvariables: IdentityHashMap<VariableId, Declaration>global, class and instance variables
Experimenting with the granularity may also reveal interesting trade offs. The only concern is that we need to be able to trace the graph from the top (declarations) and from the bottom (documents).
- From the top, we need to be able to derive the entity kind from the name. By looking at
Foo, we don't know if it's a constant, constant alias, module, class. So having a singleConstantIdprobably makes sense. However, we always know when something is a method, global, class or instance variable. So we could get very granular if that proves to reduce memory or yield better performance - From the bottom, we always know how a definition gets connected to its declaration, so it's straight forward
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels