Performance regression between 1.78 and 1.79
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
We were upgrading from rust 1.78 to 1.79 and later 1.81 and we discovered a performance regression in our applications in certain cases up to 10%.
In our benchmarks we were using iai-callgrind to measure instructions and we have seen a significant increase there.
Unfortunately, I can't provide exact code as they are proprietary but in the nature they have long callchains with lots of small functions.
The same issue was reported here.
I have bisected the 1.78 and 1.79 version and found that the following change causes performance regression: https://github.com/rust-lang/rust/commit/3412f0174934778dd803081dc7c4b5864309350f#diff-deee82aaf9baf43ab05d939355f6249fdacf8959bc0e06c9574283453f838ee9R702
Release cargo profile
codegen-units = 1
opt-level = 3
lto = "thin"
Workaround
Adding debug = 1 to the profile in release mode essentially disables this change and the performance degradation is not there anymore as expected.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting commit 3412f0174934778dd803081dc7c4b5864309350f and its referenced diff around line R702. Reproduce the regression with a suitable benchmark using iai-callgrind and the reported release profile; done means confirming and isolating the instruction increase between Rust 1.78 and later versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100