-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Add --ftime-trace functionality. #3624
Conversation
Oh wow, that's probably a valuable addition... |
@kinke What do you think of the way I added it? I tried to touch DMD frontend code as minimal as possible. Yeah, it's quite insightful to see the traces. I'm using it to try and speed up compile times at Weka (e.g. now you can see clearly that importing a particular module costs 5 seconds). If you want to try it, I recommend using Tracy for viewing the profile. Get the profile from LDC, convert it using Tracy's |
This uses LLVM's TimeProfiler functionality, such that LLVM's work is traced in the same profile (optimization and machine code gen). Functionality is meant to be identical to Clang and LLD's --ftime-trace.
fa7f6cc
to
4c3e50d
Compare
this.semavisitor = semavisitor; | ||
} | ||
|
||
alias visit = Visitor.visit; |
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.
Perhaps just use alias visit = SemaVisitor.visit
? Or do you want to be notified whenever a new override is added to SemaVisitor
and decide whether to just forward in the 90+% of cases or to add a new trace scope?
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.
That can't work because I have to forward the visit call to semavisitor.visit
instead of this.SemaVisitor.visit
. The semantic analysis visitors are final
which is probably good for performance, but requires this nuisance of manually overriding all overrides (and hence the static if check to fail when something gets added....)
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.
Ouch yeah I remember some PR which attempted to make them non-final and I opposed against it. ;)
Added a testcase before merging. |
2b1ee86
to
893a48a
Compare
Merging. The Azure failures are due to LLVM package not being available for Ubuntu 16 (but they are for 20). |
This uses LLVM's TimeProfiler functionality, such that LLVM's work is traced in the same profile (optimization and machine code gen). Functionality is meant to be identical to Clang and LLD's --ftime-trace.
This uses LLVM's TimeProfiler functionality, such that LLVM's work is traced in the same profile (optimization and machine code gen).
Functionality is meant to be identical to Clang and LLD's --ftime-trace.