Open ce-bo opened 10 months ago
Without benchmarking, I also expect the data structures being used as being highly problematic.
Right now, multiple data structures are copied each time an entry is added.
Should be e.g.:
for (const [key, name] of this.namespaceCollector.getNamespaces(parseFile)) {
namespaces.add(key, name)
}
Should be
// Note: that limits the candidates to ~100000
usagesCandidates.push(...candidates)
Concat is always copying an array and should almost never be used. Using the spread operator as above is also going to copy everything. That requires a lot of CPU cycles in addition to triggering the garbage collector frequently.
This is likely in more places a problem.
some points about possible improvements:
During Dependency Parsing:
System
in CSharp etc. (Configurable option would also be nice (e.g. exclude NameSpace UnitTest))