Skip to content

Conversation

@llogiq
Copy link
Contributor

@llogiq llogiq commented Dec 24, 2025

I found that rustc-hash is used in multiple compiler crates. Also some types use FxBuildHasher whereas others use BuildHasherDefault<FxHasher> (both do the same thing).

In order to simplify future hashing experiments, I changed every location to use rustc_data_structures::fx::* types instead, and also removed the BuildHasherDefault variant. This will simplify future experiments with hashing (for example trying out a hasher that doesn't implement Default for whatever reason).

@rustbot
Copy link
Collaborator

rustbot commented Dec 24, 2025

Some changes occurred in exhaustiveness checking

cc @Nadrieril

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 24, 2025

r? @eholk

rustbot has assigned @eholk.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

@llogiq llogiq force-pushed the rustc-hash-refactor branch from cc1e3be to 20c25b8 Compare January 4, 2026 11:37
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@llogiq llogiq force-pushed the rustc-hash-refactor branch from 20c25b8 to 7939ffb Compare January 4, 2026 11:52
@llogiq
Copy link
Contributor Author

llogiq commented Jan 4, 2026

Ok, I removed the rustc_data_structures. dependency, leaving only the change of BuildHasherDefault<FxHasher> to FxBuildHasher (because that's one less type to import, and leaves us the option of changing the algorithm in the future to something that doesn't impl Default).

@rust-log-analyzer

This comment has been minimized.

@llogiq llogiq force-pushed the rustc-hash-refactor branch from 7939ffb to 9f5645d Compare January 4, 2026 13:18
@rust-log-analyzer

This comment has been minimized.

@llogiq llogiq force-pushed the rustc-hash-refactor branch from 9f5645d to 1229efb Compare January 4, 2026 14:26
@rust-log-analyzer

This comment has been minimized.

@llogiq llogiq force-pushed the rustc-hash-refactor branch from 1229efb to 6976fbc Compare January 4, 2026 15:46
@llogiq
Copy link
Contributor Author

llogiq commented Jan 4, 2026

Ok, this compiles now and passes all tests.

@rust-bors

This comment has been minimized.

@llogiq llogiq force-pushed the rustc-hash-refactor branch from 6976fbc to 8c69712 Compare January 23, 2026 22:17
@rustbot
Copy link
Collaborator

rustbot commented Jan 23, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@llogiq
Copy link
Contributor Author

llogiq commented Jan 25, 2026

ping @eholk I assume you're busy, but this should be really quick to review.

@eholk
Copy link
Contributor

eholk commented Jan 25, 2026

Sorry about the delay! Looks good to me.

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 25, 2026

📌 Commit 8c69712 has been approved by eholk

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 25, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jan 26, 2026
refactor rustc-hash integration

I found that rustc-hash is used in multiple compiler crates. Also some types use `FxBuildHasher` whereas others use `BuildHasherDefault<FxHasher>` (both do the same thing).

In order to simplify future hashing experiments, I changed every location to use `rustc_data_structures::fx::*` types instead, and also removed the `BuildHasherDefault` variant. This will simplify future experiments with hashing (for example trying out a hasher that doesn't implement `Default` for whatever reason).
rust-bors bot pushed a commit that referenced this pull request Jan 26, 2026
Rollup of 4 pull requests

Successful merges:

 - #150353 (refactor rustc-hash integration)
 - #151611 (Improve is_ascii performance on x86_64 with explicit SSE2 intrinsics)
 - #150705 (Add missing mut to pin.rs docs)
 - #151639 (Fix broken WASIp1 reference link)
@rust-bors

This comment has been minimized.

@rust-bors rust-bors bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 26, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 26, 2026

☀️ Test successful - CI
Approved by: eholk
Duration: 3h 14m 59s
Pushing fb292b7 to main...

@rust-bors rust-bors bot merged commit fb292b7 into rust-lang:main Jan 26, 2026
12 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 26, 2026
@github-actions
Copy link
Contributor

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 873d468 (parent) -> fb292b7 (this PR)

Test differences

Show 2 test diffs

2 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard fb292b75fb6c410344f7216ec51b2eaa7cc2bb0c --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-linux: 6690.6s -> 8955.6s (+33.9%)
  2. dist-aarch64-apple: 7049.7s -> 8394.7s (+19.1%)
  3. aarch64-apple: 9601.9s -> 11260.7s (+17.3%)
  4. dist-apple-various: 3378.1s -> 3867.3s (+14.5%)
  5. aarch64-gnu-llvm-20-1: 3174.9s -> 3469.6s (+9.3%)
  6. x86_64-msvc-2: 8670.7s -> 7874.4s (-9.2%)
  7. aarch64-gnu: 7797.5s -> 7221.8s (-7.4%)
  8. aarch64-msvc-2: 6262.1s -> 5810.8s (-7.2%)
  9. dist-x86_64-musl: 7847.3s -> 7303.4s (-6.9%)
  10. dist-aarch64-llvm-mingw: 5818.8s -> 6212.6s (+6.8%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fb292b7): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -3.6%, secondary -6.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.6% [-3.6%, -3.6%] 1
Improvements ✅
(secondary)
-6.3% [-6.3%, -6.3%] 1
All ❌✅ (primary) -3.6% [-3.6%, -3.6%] 1

Cycles

Results (secondary -2.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 474.052s -> 475.284s (0.26%)
Artifact size: 383.68 MiB -> 383.64 MiB (-0.01%)

@llogiq llogiq deleted the rustc-hash-refactor branch January 30, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants