Skip to content

Performance regression between 1.78 and 1.79 #133082

Open
@havasd

Description

@havasd

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: 3412f01#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mir-opt-inliningArea: MIR inliningC-bugCategory: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions