-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
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.
running 2 tests
test bench_heapsort_new ... bench: 6,950,925 ns/iter (+/- 283,342)
test bench_heapsort_old ... bench: 7,799,111 ns/iter (+/- 181,397)
rustc 1.18.0-nightly (ddc5d7bd4 2017-04-20)
rustc --test -O slice.rs
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.