-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Collect timing data per unit for each phase #4512
Conversation
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.
Thank you! This looks good, just a few small style things for Carbon's codebase.
Co-authored-by: Jon Ross-Perkins <[email protected]>
Done! Interesting that the style here for an optional pointer is the opposite of, e.g., the style in rust-analyzer. All look good? |
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.
Looks great!
Head branch was pushed to by a user without write access
This PR adds a
--dump-timings
flag to thecompile
subcommand (similar to the existing--dump-mem-usage
flag), which collects timing data per compilation unit for each compilation phase. For example, on my 2020 M1 MacBook:Most of the changes are pretty straightforward. There were a couple I wasn't sure about though; let me know if I should change:
Timings
class in its own file, pretty similar to the existingMemUsage
classtimings_
field to theCompilationUnit
classtimings
field to theCheck::Unit
structCheckParseTree
function toCheckParseTreeInner
for ease of timing with earlyreturn