-
Notifications
You must be signed in to change notification settings - Fork 81
Add loopup caches in ModuleEnvironment to improve execution speed #2441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2441 +/- ##
=======================================
Coverage 47% 47%
- Complexity 6613 6617 +4
=======================================
Files 783 783
Lines 64650 64676 +26
Branches 9673 9672 -1
=======================================
+ Hits 30694 30715 +21
- Misses 31562 31565 +3
- Partials 2394 2396 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…d up in the heap everytime
fd6aa30
to
87e5ede
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! I think we have one cache clear
too many but I'm not sure. Please have a look.
Perf fix 1:
getModule
The profiler showed that 10% of the time was spend in the loops that were going over the
importedModules
and for every one of them aget
on the global heap.I think the only reason this indirection existed was for reloading modules, but those graphs are always kept in sync, unless a module failed to load, and then they get deleted. So that event was propagated to the down stream modules.
Benchmarking showed that this decreased runtime of the checker by about 10%
Perf fix 2:
getAllFunctions
The profiler also showed 8--10% of the time spend in calculating all functions reachable in a module. We now also have a cache around this calculation. This provided a 5% extra speed bump.
Benchmark:
A full typecheck of all stdlib (no parallel processing)
main (which includes type parameter caching #2417)
this branch