-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Generalize optimizer step profiler #15506
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cameel
commented
Oct 11, 2024
Here's what the output looks like when profiling a simple empty contract. Before
After
|
cameel
force-pushed
the
profiler-probe
branch
from
October 11, 2024 15:54
99621dc
to
68167f1
Compare
So, as can be seen in run 36438, the code does compile on all platforms. The three CLI test jobs fail, but that was already the case before due to the extra output that the profiler prints unconditionally. Perhaps we should add a proper flag for it, but in this PR I'm just leaving it as is. |
cameel
force-pushed
the
profiler-probe
branch
from
October 14, 2024 11:12
68167f1
to
3c81d80
Compare
clonker
reviewed
Oct 15, 2024
clonker
reviewed
Oct 15, 2024
clonker
reviewed
Oct 15, 2024
clonker
reviewed
Oct 15, 2024
cameel
force-pushed
the
profiler-probe
branch
from
October 15, 2024 15:56
3c81d80
to
89444f5
Compare
clonker
approved these changes
Oct 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moves the simple profiling setup we had in
Suite.cpp
and moves it into a separate class that can be easily used in random places.It also switches to static storage for the metrics, which means that we get a single report with total running time over all the Yul objects rather than one per object. Originally the profiler was used with small contracts from
test/benchmarks/
where it was probably manageable, but when profiling big projects like Uniswap or OpenZeppelin, the aggregate data is much more useful.Using the profiler is now as easy as dropping a
PROFILER_PROBE()
macro in the scope that is meant to be measured. The default probes are still placed only around the optimizer steps, but new ones can be added ad-hoc, locally.The PR also tweaks the output to make it easy to post it in comments in a readable form. It also tracks the number of calls in addition to the timing.