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

Change in release build performance after running cargo asm #239

Open
space-alien opened this issue Aug 23, 2021 · 2 comments
Open

Change in release build performance after running cargo asm #239

space-alien opened this issue Aug 23, 2021 · 2 comments

Comments

@space-alien
Copy link

After running cargo asm, I am noticing a very significant performance drop when running my release build, which I do not understand.

Given this, I wonder whether cargo asm is building my project in a different way to the normal release build. My primary concen is that the asm being produced by cargo asm may not be the same as the normal release build, since I imagine that the performance drop would indicate a significant difference in the compiled output.

Toolchain info:
nightly-x86_64-pc-windows-msvc (default) rustc 1.56.0-nightly (d3e2578c3 2021-08-21)

My process:
(1) Regular release build:
cargo build --release
target/release/myproject.exe -> Normal (i.e. fast) performance

(2) Run cargo asm:
cargo asm
target/release/myproject.exe -> Performance drops substantially (in my case, the normal release build is 50% faster)

@space-alien
Copy link
Author

Perhaps the culprit is codegen-units=1. When I set this on my release profile, I am able to reproduce the performance drop.

@FedericoStra
Copy link

Perhaps the culprit is codegen-units=1.

I have experienced a similar situation where the assembly code printed by asm does not coincide with the one actually built by cargo build --release, but they do if i use RUSTFLAGS="-Ccodegen-units=1" cargo build --release.

Unfortunately this project seems both broken and dead...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants