-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
perf: remove compiler hotspots #2981
perf: remove compiler hotspots #2981
Conversation
the changed lines triggered re-traversals of the entire AST, resulting in O(n^2) build times. for non-trivial contracts near the 24KB limit, this resulted in near-minute long build times.
Codecov Report
@@ Coverage Diff @@
## master #2981 +/- ##
==========================================
- Coverage 88.09% 88.01% -0.09%
==========================================
Files 97 97
Lines 10852 10868 +16
Branches 2574 2572 -2
==========================================
+ Hits 9560 9565 +5
- Misses 832 844 +12
+ Partials 460 459 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. |
This pull request introduces 1 alert when merging 3612c7f into feb142b - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging efead2b into 6090953 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging bd3a4fb into 72bb12e - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 0aa4ea5 into 72bb12e - view on LGTM.com new alerts:
|
What I did
reduce build time.
time vyper Vault.vy went from
0m13.121s
to0m3.521s
time vyper CurveCryptoSwap2.vy went from
0m53.054s
to0m5.259s
How I did it
investigating the time spent in various compiler phases, turns out 90% was spent in just three places.
the relevant lines triggered re-traversals of the entire AST, resulting
in O(n^2) build times. for non-trivial contracts near the 24KB limit,
this resulted in near-minute long build times.
this commit also adds timer utility functions so that the profiling can be easily done again.
How to verify it
Commit message
Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)
Description for the changelog
Cute Animal Picture