-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Bcrypt large speed regression #13510
Comments
Yes, this is a regression in Compiling with I'll see if I can pinpoint where the regression is. |
On Apple M1:
That's a 80x factor. |
|
Besides the slowdown:
|
That indeed seems to make a massive difference! |
state: State -> state: *const State Suggested by @nektro Fixes ziglang#13510
Well done, @nektro !
|
state: State -> state: *const State Suggested by @nektro Fixes ziglang#13510
Master branch helps, but #13518 still makes a difference: Apple M1:
|
I'm re-opening this issue; it can be closed when 7eed028 is reverted due to fixing the compiler codegen. |
I'm still seeing the same speed issues, although the performance has indeed improved. Running the example code I get around 1100ms for Zig 0.10.1. This is better than 0.10.0 but still about 3 times slower than 0.9.1. I know there is another issue with data passing, but I'd like to keep this issue open as this issue is still heavily impacting the usability of the algorithm. |
The Zig language allows the compiler to make this optimization automatically. We should definitely make the compiler do that, and revert this commit. However, that will not happen in this branch, and I want to continue to explore achieving performance parity with merge-base. So, this commit changes all InternPool parameters to be passed by const pointer rather than by value. I measured a 1.03x ± 0.03 speedup vs the previous commit compiling the (set of passing) behavior tests. Against merge-base, this commit is 1.17x ± 0.04 slower, which is an improvement from the previous measurement of 1.22x ± 0.02. Related issue: #13510 Related issue: #14129 Related issue: #15688
The Zig language allows the compiler to make this optimization automatically. We should definitely make the compiler do that, and revert this commit. However, that will not happen in this branch, and I want to continue to explore achieving performance parity with merge-base. So, this commit changes all InternPool parameters to be passed by const pointer rather than by value. I measured a 1.03x ± 0.03 speedup vs the previous commit compiling the (set of passing) behavior tests. Against merge-base, this commit is 1.17x ± 0.04 slower, which is an improvement from the previous measurement of 1.22x ± 0.02. Related issue: #13510 Related issue: #14129 Related issue: #15688
The Zig language allows the compiler to make this optimization automatically. We should definitely make the compiler do that, and revert this commit. However, that will not happen in this branch, and I want to continue to explore achieving performance parity with merge-base. So, this commit changes all InternPool parameters to be passed by const pointer rather than by value. I measured a 1.03x ± 0.03 speedup vs the previous commit compiling the (set of passing) behavior tests. Against merge-base, this commit is 1.17x ± 0.04 slower, which is an improvement from the previous measurement of 1.22x ± 0.02. Related issue: ziglang#13510 Related issue: ziglang#14129 Related issue: ziglang#15688
The Zig language allows the compiler to make this optimization automatically. We should definitely make the compiler do that, and revert this commit. However, that will not happen in this branch, and I want to continue to explore achieving performance parity with merge-base. So, this commit changes all InternPool parameters to be passed by const pointer rather than by value. I measured a 1.03x ± 0.03 speedup vs the previous commit compiling the (set of passing) behavior tests. Against merge-base, this commit is 1.17x ± 0.04 slower, which is an improvement from the previous measurement of 1.22x ± 0.02. Related issue: #13510 Related issue: #14129 Related issue: #15688
Running zig-0.11.0-dev.4003, I have reran the experiment. The speed I'm getting for the above code snippet is 320ms. I would consider this an acceptable speed as it is faster than the 0.9 implementation. I would consider closing this ticket as fixed. |
See 90a877f for related issues. |
Possible reduction of this issue: #17580 |
Zig Version
0.10.0
Steps to Reproduce and Observed Behavior
The speed of Bcrypt with equal/similar parameters as Zig 0.9.x has regressed by about a factor 10 in 0.10.0. This severely reduces the usability of the implementation as we have this now.
Code as tested:
This code on my machine has around the following results:
Zig 0.9: 392ms
Zig 0.10: 5128ms
Expected Behavior
The speed of the algorithm should be similar the speed in Zig 0.9.
The text was updated successfully, but these errors were encountered: