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

LLVM 6 upgrade caused ~25% runtime regression for inflate 0.3.4 decoding #50560

Closed
anp opened this issue May 9, 2018 · 8 comments
Closed

LLVM 6 upgrade caused ~25% runtime regression for inflate 0.3.4 decoding #50560

anp opened this issue May 9, 2018 · 8 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-slow Issue: Problems and improvements with respect to performance of generated code. WG-llvm Working group: LLVM backend code generation

Comments

@anp
Copy link
Member

anp commented May 9, 2018

After bisecting, 39abcc0 introduced a roughly 25% increase in the runtime of lolbench's inflate_0_3_4::decode benchmark.

Summary:

rust-lang/rust commit est. runtime 95% ci
3bcda48 1.5933 ms 1.5778,1.6081
39abcc0 1.9997 ms 1.9914,2.0083
change ~ 25 %

The regression is (hopefully) reproducible by cloning:

$ git clone https://github.com/anp/inflate-regression
$ cd inflate-regression

(note: I haven't reduced this beyond the inflate crate's public API -- I need to try to find the actual section of code that's affected)

Here's my output (2016 MBP15). I ran these on my laptop after seeing the change on a x86_64-unknown-linux-gnu machine first.

(rustup targets downloaded by cargo-bisect-rustc)

3bcda48, bors merge before LLVM 6:

$ cargo +ci-3bcda48a30b21e46b81a7989deb30a3ba85fb918-x86_64-apple-darwin run --release
...
decode                  time:   [1.5778 ms 1.5933 ms 1.6081 ms]
...

39abcc0:

$ cargo +ci-39abcc04139a0fd24422f422271849dc91e39a88-x86_64-apple-darwin run --release
...
decode                  time:   [1.9914 ms 1.9997 ms 2.0083 ms]

Current nightly:

$ cargo +nightly run --release
...
decode                  time:   [1.9383 ms 1.9466 ms 1.9555 ms]
...
@anp
Copy link
Member Author

anp commented May 9, 2018

cc @rust-lang/wg-codegen

@kennytm kennytm added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. I-slow Issue: Problems and improvements with respect to performance of generated code. C-bug Category: This is a bug. WG-llvm Working group: LLVM backend code generation labels May 9, 2018
@upsuper
Copy link
Contributor

upsuper commented May 10, 2018

Might be related to #49873.

@eddyb
Copy link
Member

eddyb commented May 11, 2018

Please always compare inflate performance changes before and after the debloating image-rs/inflate#35 (which greatly reduces the code passed to LLVM).

@anp
Copy link
Member Author

anp commented May 15, 2018

Haven't had time to reduce this further yet, but a fix for one potential culprit has been backported: rust-lang/llvm#115. Will see what results for this are like when that's in nightly.

@nikic
Copy link
Contributor

nikic commented May 21, 2018

Current nightly did not improve this, so this is unrelated to #49873.

@anp
Copy link
Member Author

anp commented May 21, 2018

@nikic thanks for checking! I'll try to reduce this soon then.

@steveklabnik
Copy link
Member

Triage: it's been over a year. We're on LLVM... 8? now? Is this ticket still relevant?

@nox
Copy link
Contributor

nox commented Sep 22, 2019

Closing it.

@nox nox closed this as completed Sep 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-slow Issue: Problems and improvements with respect to performance of generated code. WG-llvm Working group: LLVM backend code generation
Projects
None yet
Development

No branches or pull requests

7 participants