-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Strange Rust heapsort performance difference, missed obvious llvm optimization #41448
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
Comments
Not reproducible. The two have similar performance here (MacBook Pro). What is your platform?
|
My platform is x64 Linux on 8core intel xeon. |
Can't reproduce this either
|
The generated assembly is in fact different between the versions, heapsort_old vs heapsort_new. |
I tested it on my |
I'm seeing a ~1% difference in favor of the |
On the current nightly compiler: |
I have a strange performance difference on the standard rust heapsort implementation and a trivial modification.
The only difference is in line 15 where the right index is calculated from the left index. I thought this is a trivial optimization for a compiler.
Related gist
rustc 1.18.0-nightly (ddc5d7bd4 2017-04-20)
rustc --test -O slice.rs
The text was updated successfully, but these errors were encountered: