-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Apply Profile-guided optimization to improve performance #9412
Comments
It would be feasibly, but the tradeoff between additional perf boost and additional burden of maintaining a more complex build process is not worth it at this stage. It’s more impactful to spend the effort on making rust-analyzer more performant directly. The primary blocker for that work is understanding rust-analyzer’s heap structure: #9309 |
I just tried this, it's an ~8% improvement in
Steps for posterity, since they weren't obvious: RUSTFLAGS="-C profile-generate" cargo build --release
target/release/rust-analyzer analysis-stats .
llvm-profdata merge *.profraw --output merged.profdata
RUSTFLAGS="-C profile-use=$PWD/merged.profdata" cargo build --release Probably not worth the hassle for now. |
Was some time since this issue and RA is maturing quite nicely, maybe we should look over this again? |
for a speed-up of 20%. For
(19% faster) My steps in #9412 (comment) still work, but seem to yield a smaller improvement. I'm not sure if In any case, 15-20% is a decent improvement. |
Great! This looks awesome, 15-20% is a huge improvement. |
15-20% is a drop in the ocean compared to the algorithmic improvements (that nobody had time/managed/knew how to make) 😅. |
@lnicola It has been quite some time since the last time PGO was evaluated, Are rust-analyzer in a better state where it may be suitable to distribute PGO-optimized builds? |
Are PGO builds now distributed? |
No. There are still bigger wins to be gained (which nobody tries currently AFAIK). |
Are you referring to this? #9309 |
@ChayimFriedman2 jfyi, i am using rust-analyzer every day, all day - every single percent shaved off of runtime of this tool is a huge win for my work day. I urge you to not ignore a 15% win that is basically coming for free. |
I think as of right now there is a bug with PGO + LTO in the rust compiler preventing both to be used simultaneously, so any exploration of eventual performance would probably be best after that is fixed. |
Profile-guided optimization (PGO) shows great promise in improving the speed of software, last year tests where made on applying it on Rust itself improving build time by ~15%.
Would it be feasible to do something similar for Rust analyzer to improve its speed?
As i understand it the difficulties would be
The text was updated successfully, but these errors were encountered: