Skip to content
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

Huge performance gap between lto="fat",cgu=1 and default release profile #93321

Open
Robbepop opened this issue Jan 26, 2022 · 0 comments
Open
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code. O-wasm Target: WASM (WebAssembly), http://webassembly.org/

Comments

@Robbepop
Copy link
Contributor

Robbepop commented Jan 26, 2022

I was told on Rust's Discord that I should maybe post this issue here together with my research so far which can be found following this GitHub issue link. The GitHub issue links to other sources of information such as the GitHub Gist that accumulates a lot of benchmark results.

The tl;dr is that we see slowdowns of up to x4.21 with the default release profile compared to using

[profile.release]
lto = "fat"
codegen-units = 1

Which is a lot more than the 10-15% that I usually see between both profiles.

People told me that maybe this is due to some edge cases within the optimization pipeline. I personally ran out of ideas since whatever I do I usually see slowdowns of at least 75-100% which is unacceptable since this is a very performance critical library. The major problem with the custom profile using lto="fat",cgu=1 is that it compiled massively slow and probably won't be used by all library users by default which will lead to very poor performance in the default case for those users. The only thing I can do rn is to spam potential users with warnings about using the correct profile settings.


I also asked this in Rust's Zulip but didn't gain a lot of really useful information out of it unfortunately.

@apiraino apiraino added I-slow Issue: Problems and improvements with respect to performance of generated code. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ labels Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code. O-wasm Target: WASM (WebAssembly), http://webassembly.org/
Projects
None yet
Development

No branches or pull requests

2 participants