-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
compiler generate slower code in my benchmarks, after upgrade from 0.13.0 to master #24014
Comments
At least for Old asm for the inner loop: 0,05 │4e0: cmp %rdx,%rax
│ ↓ jae 50e
0,03 │4e5: mov (%rbx),%rbp
0,20 │ cmp %rbp,%rax
0,05 │ ↓ jae 527
28,57 │4ed: mov (%r8),%rbp
0,03 │ mov (%rdi),%r9
0,04 │ movsd (%r9,%rax,8),%xmm1
0,30 │ mulsd 0x0(%rbp,%rax,8),%xmm1
40,50 │ lea 0x1(%rax),%rax
0,06 │ addsd %xmm1,%xmm0
29,15 │ cmp %r12,%rax
│ ↑ jb 4e0 New asm: │1 600: mov %rsi,%rcx
21,23 │ add $0x1,%rcx
0,03 │ cmovb %r12,%rcx
0,02 │ cmp %rsi,%rdx
0,03 │ ↓ jbe 638
20,87 │1 610: mov 0x0(%rbp),%rbx
0,10 │ cmp %rsi,%rbx
│ ↓ jbe 646
0,03 │1 619: mov (%r9),%rbx
0,01 │ mov (%rdi),%r15
21,45 │ movsd (%r15,%rsi,8),%xmm1
0,21 │ mulsd (%rbx,%rsi,8),%xmm1
7,03 │ addsd %xmm1,%xmm0
28,06 │ cmp %r12,%rcx
0,02 │ mov %rcx,%rsi
│ ↑ jb 600 That extra cc @aturon |
@dotdash when you say "the checked add +", do you mean artihmetic overflow detection? Are you thinking that even when one passes |
@pnkfelix I suspect https://github.com/rust-lang/rust/blob/master/src/libcore/iter.rs#L2468-L2470 is the culprit -- the |
@pnkfelix Yes, |
Note that the traits here are unstable, and it may be best to break them up for these distinct cases (or perhaps to instead switch to some other design). Do either of you want to take this on? If not, I can look into it next week. |
I'm trying to get some other things done and only checked this to see if it's related, so I'll have to pass. |
The brainfuck benchmark seems to be (at least in part) slowed down by integer overflow checks in the |
A recent change to the implementation of range iterators meant that, even when stepping by 1, the iterators *always* involved checked arithmetic. This commit reverts to the earlier behavior (while retaining the refactoring into traits). Fixes rust-lang#24095 cc rust-lang#24014
A recent change to the implementation of range iterators meant that, even when stepping by 1, the iterators *always* involved checked arithmetic. This commit reverts to the earlier behavior (while retaining the refactoring into traits). Fixes rust-lang#24095 cc rust-lang#24014
A recent change to the implementation of range iterators meant that, even when stepping by 1, the iterators *always* involved checked arithmetic. This commit reverts to the earlier behavior (while retaining the refactoring into traits). Fixes #24095 Closes #24119 cc #24014 r? @alexcrichton
confirm that matmul fixed kostya/benchmarks@5e8409f |
Since the hashmap and its hasher are implemented in different crates, we currently can't benefit from inlining, which means that especially for small, fixed size keys, there is a huge overhead in hash calculations, because the compiler can't apply optimizations that only apply for these keys. Fixes the brainfuck benchmark in rust-lang#24014.
Since the hashmap and its hasher are implemented in different crates, we currently can't benefit from inlining, which means that especially for small, fixed size keys, there is a huge overhead in hash calculations, because the compiler can't apply optimizations that only apply for these keys. Fixes the brainfuck benchmark in #24014.
@kostya can you confirm that the brainfuck performance is good again now? |
yes brainfuck in 1.2-nighly much faster kostya/benchmarks@34ff509...378760b (btw still slower than javascript :) ) |
about |
https://github.com/kostya/benchmarks
update is here: kostya/benchmarks@042ee51...78ef5f2
The text was updated successfully, but these errors were encountered: