-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cleanup and speed-up of type resolution #1690
Conversation
Speedup (start to end cpg parsing (frontend + passes)) against current |
9bba11a
to
d563993
Compare
1975f92
to
6d64aab
Compare
Unfortunately, while this speeds up python, this slows down the |
Solved |
Quality Gate passedIssues Measures |
A map of lists instead of a simple list
eebe5d6
to
3d30cdb
Compare
I will split this up into multiple issues/PRs since this became unmanageable. |
This PR should speed up type handling immensely. The list of first oder types is now a map of a list instead of a list. The issue is that we have a lot of "types" (remember, a "type" is a unique combination of a scope and a name), we potentially have many scopes and a simple "myType" can exist as multiple
Type
nodes before the type resolver harmonises this. In order to at least have unique types per scope, we iterate existing types and return one that matches the name/scope combination. This was previously done over the complete list and is now only restricted to those types whos name matches in the first place.This is more a workaround than a complete solution to the problem of types but should at least be significantly faster now.
Benchmarks
As a benchmark I parsed http://github.com/openstack/glance with default passes (without CDG/PDG because they are broken currently for Python). This speeds up the parsing from 68s to 32s.
MacBook Air, 13-inch, M3, 2024, 16 GB
Before:
After: