Skip to content
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

Use FxIndexMap instead FxHashMap to stabilize iteration order in EffectiveVisibilities #121851

Merged
merged 2 commits into from Mar 31, 2024

Conversation

michaelwoerister
Copy link
Member

Part of MCP 533.

@rustbot
Copy link
Collaborator

rustbot commented Mar 1, 2024

r? @cjgillot

rustbot has assigned @cjgillot.
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

@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 Mar 1, 2024
@michaelwoerister
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 1, 2024
@bors
Copy link
Contributor

bors commented Mar 1, 2024

⌛ Trying commit a50490c with merge 20a1b6d...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 1, 2024
…is, r=<try>

Use FxIndexMap instead FxHashMap to stabilize iteration order in EffectiveVisibilities

Part of [MCP 533](rust-lang/compiler-team#533).
@bors
Copy link
Contributor

bors commented Mar 1, 2024

☀️ Try build successful - checks-actions
Build commit: 20a1b6d (20a1b6db223806bd9fa3126be395eb2e7396680f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (20a1b6d): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking 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 @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.3%] 5
Regressions ❌
(secondary)
0.5% [0.4%, 0.6%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 4
All ❌✅ (primary) 0.2% [0.1%, 0.3%] 5

Max RSS (memory usage)

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
8.7% [5.7%, 11.0%] 5
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
-1.6% [-1.8%, -1.4%] 2
All ❌✅ (primary) -2.3% [-2.3%, -2.3%] 1

Cycles

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.1% [-1.7%, -0.6%] 2
Improvements ✅
(secondary)
-4.1% [-5.7%, -2.1%] 6
All ❌✅ (primary) -1.1% [-1.7%, -0.6%] 2

Binary size

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

Bootstrap: 651.828s -> 653.326s (0.23%)
Artifact size: 311.10 MiB -> 311.15 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 1, 2024
@michaelwoerister
Copy link
Member Author

I'm going to run a callgrind diff on the libc-check-full case to if the small regression is real.

@michaelwoerister
Copy link
Member Author

set_bindings_effective_visibilities (which uses the map in question) does show up with an instruction count increase for the libc and unused-warnings benchmarks. The code seems to do a bit more work with FxIndexMap instead of FxHashMap. However, I don't see how that can be changed without a bigger refactoring of code that otherwise does not look like it's in need of refactoring. Using UnordMap instead of FxIndexMap is non-trivial too, since EffectiveVisibilities public exposes an iter method that gives access to internal map.

I think the small regression is acceptable, since this is a correctness/incr-comp-hardening fix.

@michaelwoerister
Copy link
Member Author

michaelwoerister commented Mar 4, 2024

@rustbot label: +perf-regression-triaged
(please let me know if there's disagreement on that)

@rustbot

This comment was marked as outdated.

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Mar 4, 2024
@cjgillot
Copy link
Contributor

cc @petrochenkov as this touches effective visibilities.

@michaelwoerister
Copy link
Member Author

I just noticed that this is now the last instance of a HashMap occurring in a query result, so I pushed 7e4bc4a which removes and disallows the HashStable impl for HashMap 🎉

@petrochenkov
Copy link
Contributor

Effective visibility changes look ok.
unused-warnings and libc are stress tests for effective visibilities, so they will regress a bit if FxIndexMap is any slower than FxHashMap.

@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Mar 31, 2024

📌 Commit 7e4bc4a has been approved by cjgillot

It is now in the queue for this repository.

@bors bors 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 Mar 31, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 31, 2024
…is, r=cjgillot

Use FxIndexMap instead FxHashMap to stabilize iteration order in EffectiveVisibilities

Part of [MCP 533](rust-lang/compiler-team#533).
@bors
Copy link
Contributor

bors commented Mar 31, 2024

⌛ Testing commit 7e4bc4a with merge 1e98e80...

@rust-log-analyzer
Copy link
Collaborator

The job armhf-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Mar 31, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 31, 2024
@cjgillot
Copy link
Contributor

@bors retry

@bors bors 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 Mar 31, 2024
@klensy
Copy link
Contributor

klensy commented Mar 31, 2024

Gh gone crazy? Few first posts dated 1 mar, but written as "commented now".

@bors
Copy link
Contributor

bors commented Mar 31, 2024

⌛ Testing commit 7e4bc4a with merge bf71dae...

@bors
Copy link
Contributor

bors commented Mar 31, 2024

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing bf71dae to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 31, 2024
@bors bors merged commit bf71dae into rust-lang:master Mar 31, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Mar 31, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bf71dae): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.3% [0.2%, 0.4%] 13
Regressions ❌
(secondary)
0.4% [0.3%, 0.4%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.2%, 0.4%] 13

Max RSS (memory usage)

Results

This 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.

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

Cycles

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.8% [-1.9%, -1.7%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.8% [-1.9%, -1.7%] 3

Binary size

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

Bootstrap: 669.417s -> 666.819s (-0.39%)
Artifact size: 315.68 MiB -> 315.68 MiB (0.00%)

@Mark-Simulacrum
Copy link
Member

See #121851 (comment) for justification.

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. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

None yet

9 participants