Rewrite rustc_span::symbol::Interner to avoid double hashing#157252
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Rewrite `rustc_span::symbol::Interner` to avoid double hashing
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (e66b004): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.6%, secondary 1.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -2.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 509.892s -> 512.954s (0.60%) |
|
The red numbers in |
|
I've added locking enhancements to reduce contention, maybe this will cause some improvement (or maybe the contrary). Of course, this is only relevant in multithreaded benches, i'm not sure if we can reliably test this. Also, due to my lack of experience, I'd like a more professional look at whether I have some concurrency bugs. I think I've mitigated the TOCTOU and locking order is deterministic. My benches and tests run fine. |
This comment has been minimized.
This comment has been minimized.
Could you remove this change from this PR? Otherwise LGTM, left some style nits. |
|
Reminder, once the PR becomes ready for a review, use |
5c67961 to
ec77a49
Compare
Involves resorting to raw `HashTable` and writing an ad-hoc `IndexMap`-like structure, as we cannot get access to raw hashes otherwise. My local cachegrind profile shows ~ -20_000_000 Ir
ec77a49 to
00d08cb
Compare
|
@rustbot ready |
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing cb46fbb (parent) -> 83b3bfc (this PR) Test differencesShow 5 test diffsStage 0
Stage 1
Additionally, 3 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 83b3bfc40a9d2fb07dd08a275d80a6ba8a903f18 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (83b3bfc): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Our benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.9%, secondary 2.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeResults (primary -0.0%, secondary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 517.707s -> 516.634s (-0.21%) |
View all comments
Involves resorting to raw
HashTableand writing an ad-hocIndexMap-like structure, as we cannot get access to raw hashes otherwise.My local cachegrind profile shows ~ -20_000_000 Ir
r? @petrochenkov