-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
WIP: vendor rustc-hash and override str/length_prefix methods #120078
Conversation
Locally avoiding length and str sentinel hashing adds 2,611,200 cases of hashes with just one add_to_hash call (out of roughly 43,063,296 total cases). Unclear what kind of effect this will have on runtime performance at this time, but seems like it's worth trying!
@Mark-Simulacrum: no appropriate reviewer found, use r? to override |
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
@bors try @rust-timer queue cc #96762 -- probably worthwhile data for that tracking issue, regardless of whether positive or negative. |
This comment has been minimized.
This comment has been minimized.
WIP: vendor rustc-hash and override str/length_prefix methods Locally avoiding length and str sentinel hashing adds 2,611,200 cases of hashes with just one add_to_hash call (out of roughly 43,063,296 total cases). Unclear what kind of effect this will have on runtime performance at this time, but seems like it's worth trying!
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
05a5c72
to
b24c62d
Compare
@bors try |
WIP: vendor rustc-hash and override str/length_prefix methods Locally avoiding length and str sentinel hashing adds 2,611,200 cases of hashes with just one add_to_hash call (out of roughly 43,063,296 total cases). Unclear what kind of effect this will have on runtime performance at this time, but seems like it's worth trying! cc rust-lang#56308
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (256f15b): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 663.454s -> 664.246s (0.12%) |
The job Click to see the possible cause of the failure (guessed by this bot)
|
@bors try @rust-timer queue It looks like we have pretty terrible hash quality for strings -- looking locally, e.g., libcore has ~70k Symbols so roughly speaking the ~17 lower bits of the hash function are getting used. For simplicity if we take the lower 16 bits we can see there are 41.7k unique values when hashing in 0xFF and 39.9k unique values when just hashing the bytes of the string. My guess is that final 0xFF hash helps smear/distribute short tails which otherwise dominate the hash's value too much. For now I'm going to re-run with 0xFF added back in but I think we should consider whether hashing long byte strings is actually working well enough -- and maybe a different hash function would be better for maps where we have non (roughly) u32 integers as keys. The two benchmarks that regressed here have similarly not-great performance for the hash function, which is why they're regressing so much. |
This comment has been minimized.
This comment has been minimized.
WIP: vendor rustc-hash and override str/length_prefix methods Locally avoiding length and str sentinel hashing adds 2,611,200 cases of hashes with just one add_to_hash call (out of roughly 43,063,296 total cases). Unclear what kind of effect this will have on runtime performance at this time, but seems like it's worth trying! cc rust-lang#56308
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (f7f7717): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 663.584s -> 666.051s (0.37%) |
Seems like this didn't really pan out directly. |
Locally avoiding length and str sentinel hashing adds 2,611,200 cases of hashes with just one add_to_hash call (out of roughly 43,063,296 total cases). Unclear what kind of effect this will have on runtime performance at this time, but seems like it's worth trying!
cc #56308