-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Performance regression introduced by commit 760b93a #14939
Comments
This is likely explained in my description of #14538
|
cc me |
The ability to use single-pass hashing instead of state machines is important and seems to be missing or at least not leveraged. At the moment, Rust's SipHash implementation is far slower than a naive C implementation, and that's without getting into the large gains you can get by using SIMD.
I don't think that's a satisfactory workaround. In addition to not providing protection against pathological data (DoS attacks), FNV is also a very weak hash and suffers from many collisions even with random inputs. It's also not the default hash, and the out-of-the-box performance is what matters most. AFAIK, a proper SipHash implementation is significantly faster in terms of cycles per byte than FNV, and should be winning on large keys where the initial cost becomes less significant. |
So it's clear, is the current consensus that the issue could be that the default hashing algorithm was switched to FNV from SipHash? If so, what's preventing the switch back? |
@thestinger What should our hashing API be? I guess it needs to be redesigned? |
@SergioBenitez no, the default hashing algorithm has not changed. If there are problems with the SipHash implementation, please file them as seperate issues and let's fix them. |
@pcwalton: Ideally, |
I'm untagging all pre-1.0 regressions to repurpose it for stable regressions. |
A pretty huge amount of time has changed since this was originally filed, so I'm going to close this as "probably stale", although if numbers still show a regression we should definitely fix! |
fix: Fix nav target calculation discarding file ids from differing macro upmapping Fixes rust-lang/rust-analyzer#14792 Turns out there was the assumption that upmapping from a macro will always end in the same root file, which is no longer the case thanks to `include!`
Commits 6a58537 / 760b93a (Thu May 29 19:03:06) introduced a performance regression in std::collections::HashMap insertion. The regression appears to be isolated to instances where the key is a string, but I have only tested with string and integer keys.
I have set up a test benchmark at https://github.com/SergioBenitez/rust-perf-regression that showcases the issue. It inserts 100 string/int key/value pairs into a HashMap.
good.sh
runs the benchmark using the last good compiler build, 3ec321f, andbad.sh
runs the first bad compiler build, 760b93a, assuming rustc from 3ec321f is in/usr/local/good/bin/rustc
and rustc from 760b93a is in the current$PATH
.Here are the results on my machine (Core i7-920, 24GB RAM, OS X 10.9.2):
@cmr on IRC suggested adding -Z lto. Here are the results with that flag:
As can be seen, the binary built from the compiler at 760b93a is about 25% slower than the binary from the compiler at 3ec321f.
The text was updated successfully, but these errors were encountered: