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

Only store StableCrateId once in DefPathTable. #119259

Merged
merged 3 commits into from
Dec 29, 2023

Conversation

cjgillot
Copy link
Contributor

#119238 made me think of this.

cc @Mark-Simulacrum

@rustbot
Copy link
Collaborator

rustbot commented Dec 23, 2023

r? @b-naber

(rustbot has picked a reviewer for you, use r? to override)

@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 23, 2023
def_path_hash_to_index: Default::default(),
}
}

fn allocate(&mut self, key: DefKey, def_path_hash: DefPathHash) -> DefIndex {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW it looks like we're also hashing the parent's stable crate ID into the local part of this hash --

parent.hash(&mut hasher);

It's probably pretty cheap (just an extra u64 hashed in) but seems like it would be correct to skip that hashing since we're not crossing crate boundaries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes a lot of hash-dependent behaviour, so I'll investigate this in a follow-up PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perf results don't look particularly meaningful either, so it might not really matter.

@Mark-Simulacrum
Copy link
Member

r=me

@cjgillot
Copy link
Contributor 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 Dec 24, 2023
@bors
Copy link
Contributor

bors commented Dec 24, 2023

⌛ Trying commit 62b611e with merge 53c94be...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 24, 2023
Only store StableCrateId once in DefPathTable.

rust-lang#119238 made me think of this.

cc `@Mark-Simulacrum`
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Dec 24, 2023

☀️ Try build successful - checks-actions
Build commit: 53c94be (53c94be95e622cd89cc4f453f0c2d8db8349484e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (53c94be): 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.9% [0.9%, 0.9%] 1
Regressions ❌
(secondary)
1.1% [1.1%, 1.1%] 1
Improvements ✅
(primary)
-0.3% [-1.1%, -0.2%] 17
Improvements ✅
(secondary)
-0.2% [-0.4%, -0.2%] 14
All ❌✅ (primary) -0.2% [-1.1%, 0.9%] 18

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)
3.4% [3.4%, 3.4%] 1
Improvements ✅
(primary)
-1.7% [-2.1%, -1.2%] 2
Improvements ✅
(secondary)
-2.8% [-2.8%, -2.8%] 1
All ❌✅ (primary) -1.7% [-2.1%, -1.2%] 2

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.1%, -1.1%] 1
Improvements ✅
(secondary)
-3.3% [-4.5%, -2.1%] 6
All ❌✅ (primary) -1.1% [-1.1%, -1.1%] 1

Binary size

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.1% [0.1%, 0.1%] 4
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.1%, 0.1%] 4

Bootstrap: 670.687s -> 670.155s (-0.08%)
Artifact size: 312.77 MiB -> 312.78 MiB (0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 24, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@cjgillot cjgillot force-pushed the single-crate-id branch 2 times, most recently from c1fb22b to 821920b Compare December 24, 2023 17:23
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Dec 29, 2023

📌 Commit 821920b has been approved by Mark-Simulacrum

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 Dec 29, 2023
@bors
Copy link
Contributor

bors commented Dec 29, 2023

⌛ Testing commit 821920b with merge dc450f9...

@bors
Copy link
Contributor

bors commented Dec 29, 2023

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing dc450f9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 29, 2023
@bors bors merged commit dc450f9 into rust-lang:master Dec 29, 2023
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Dec 29, 2023
@cjgillot cjgillot deleted the single-crate-id branch December 29, 2023 17:35
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (dc450f9): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -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.8% [0.8%, 0.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.6%, -0.2%] 78
Improvements ✅
(secondary)
-0.4% [-0.6%, -0.3%] 16
All ❌✅ (primary) -0.3% [-0.6%, 0.8%] 79

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)
3.9% [2.6%, 5.4%] 4
Improvements ✅
(primary)
-1.6% [-2.5%, -0.5%] 18
Improvements ✅
(secondary)
-3.1% [-6.4%, -1.0%] 8
All ❌✅ (primary) -1.6% [-2.5%, -0.5%] 18

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.5% [0.5%, 0.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.9% [-1.0%, -0.7%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.5% [-1.0%, 0.5%] 4

Binary size

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.6% [-5.1%, -0.1%] 114
Improvements ✅
(secondary)
-2.7% [-6.9%, -0.0%] 76
All ❌✅ (primary) -1.6% [-5.1%, -0.1%] 114

Bootstrap: 670.236s -> 671.694s (0.22%)
Artifact size: 312.30 MiB -> 312.04 MiB (-0.08%)

@rustbot rustbot removed the perf-regression Performance regression. label Dec 29, 2023
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. 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.

7 participants