-
Notifications
You must be signed in to change notification settings - Fork 323
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
Optimize AliasAnalysis hotspot #8701
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.
Nice finding!
From a strategic perspective we should first address
and only then integrate this bugfix. Then we could demonstrate on the graphs how much we do care about static compiler speed.
On the other hand, we do have the Startup_empty_startup
benchmark and if that one is improving, then we have an (at least indirect) evidence as well.
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.
Very nice improvement. Just out of curiosity: Do you have profiling snapshots? If so, please attach some screenshots from them.
Yes, I agree we need proper benchmarks. As I talked to @4e6 I think there is a big scope for improving the compiler performance, we haven't even started. I was hoping that I also added some screenshots. It's a bit hard to show but basically traversing a list is gone. |
Maybe the reason is because it is not built against latest develop. I will retry. |
ef26afc
to
d268be8
Compare
`scopeFor` is a real hotspot that hasn't been particularly optimized. By using iterator and a simple variable instead of a list and checking its length I was able to get 10% speedup. Note that it seems tempting to throw the exception within the loop but that seems to create a less optimized code.
d268be8
to
3eed80f
Compare
Pull Request Description
scopeFor
is a real hotspot that hasn't been particularly optimized. By using iterator and a simple variable instead of a list and checking its length I was able to get 10% speedup.Note that it seems tempting to throw the exception within the loop but that seems to create a less optimized code.
Important Notes
I'm consistently getting ~10% speedup on a hello world example (with standard libraries).
For example I'm no longer seeing 20ms spent in
scopeFor
and most of them are below 10ms:Before
After
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.