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

Store a index per dep node kind #115733

Merged
merged 3 commits into from Sep 16, 2023
Merged

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Sep 10, 2023

This stores an index map per dep node kind instead of using a single index map. This avoids storing DepKind in the key for greater cache efficiency.

BenchmarkBeforeAfterBeforeAfter
TimeTime%MemoryMemory%
🟣 clap:check:unchanged0.4376s0.4334s -0.95%92.53 MiB92.39 MiB -0.15%
🟣 hyper:check:unchanged0.1442s0.1446s 0.29%47.48 MiB47.63 MiB 0.31%
🟣 regex:check:unchanged0.3296s0.3261s💚 -1.06%72.37 MiB71.20 MiB💚 -1.62%
🟣 syn:check:unchanged0.6149s0.6014s💚 -2.19%105.74 MiB101.69 MiB💚 -3.83%
🟣 syntex_syntax:check:unchanged1.4882s1.4560s💚 -2.16%209.75 MiB201.46 MiB💚 -3.95%
Total3.0144s2.9616s💚 -1.75%527.87 MiB514.37 MiB💚 -2.56%
Summary1.0000s0.9879s💚 -1.21%1 byte0.98 bytes💚 -1.85%

@rustbot
Copy link
Collaborator

rustbot commented Sep 10, 2023

r? @b-naber

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

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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 Sep 10, 2023
@lqd
Copy link
Member

lqd commented Sep 10, 2023

@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 Sep 10, 2023
@bors
Copy link
Contributor

bors commented Sep 10, 2023

⌛ Trying commit 769a81e with merge e190874...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 10, 2023
Store a index per dep node kind

This stores an index map per dep node kind instead of using a single index map. This avoids storing `DepKind` in the key for greater cache efficiency.

<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th><td align="right">Memory</td><td align="right">Memory</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:unchanged</td><td align="right">0.4376s</td><td align="right">0.4334s</td><td align="right"> -0.95%</td><td align="right">92.53 MiB</td><td align="right">92.39 MiB</td><td align="right"> -0.15%</td></tr><tr><td>🟣 <b>hyper</b>:check:unchanged</td><td align="right">0.1442s</td><td align="right">0.1446s</td><td align="right"> 0.29%</td><td align="right">47.48 MiB</td><td align="right">47.63 MiB</td><td align="right"> 0.31%</td></tr><tr><td>🟣 <b>regex</b>:check:unchanged</td><td align="right">0.3296s</td><td align="right">0.3261s</td><td align="right">💚  -1.06%</td><td align="right">72.37 MiB</td><td align="right">71.20 MiB</td><td align="right">💚  -1.62%</td></tr><tr><td>🟣 <b>syn</b>:check:unchanged</td><td align="right">0.6149s</td><td align="right">0.6014s</td><td align="right">💚  -2.19%</td><td align="right">105.74 MiB</td><td align="right">101.69 MiB</td><td align="right">💚  -3.83%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:unchanged</td><td align="right">1.4882s</td><td align="right">1.4560s</td><td align="right">💚  -2.16%</td><td align="right">209.75 MiB</td><td align="right">201.46 MiB</td><td align="right">💚  -3.95%</td></tr><tr><td>Total</td><td align="right">3.0144s</td><td align="right">2.9616s</td><td align="right">💚  -1.75%</td><td align="right">527.87 MiB</td><td align="right">514.37 MiB</td><td align="right">💚  -2.56%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9879s</td><td align="right">💚  -1.21%</td><td align="right">1 byte</td><td align="right">0.98 bytes</td><td align="right">💚  -1.85%</td></tr></table>
@bors
Copy link
Contributor

bors commented Sep 10, 2023

☀️ Try build successful - checks-actions
Build commit: e190874 (e1908748729226ac01c251cd44097a9bafb5cbfe)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e190874): comparison URL.

Overall result: ❌ regressions - 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)
1.3% [0.3%, 2.3%] 104
Regressions ❌
(secondary)
1.5% [0.4%, 2.2%] 42
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.3% [0.3%, 2.3%] 104

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)
4.1% [4.0%, 4.3%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.6% [-5.3%, -1.0%] 19
Improvements ✅
(secondary)
-4.3% [-4.4%, -4.3%] 3
All ❌✅ (primary) -2.0% [-5.3%, 4.3%] 21

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)
-3.2% [-6.6%, -1.5%] 70
Improvements ✅
(secondary)
-5.6% [-10.8%, -2.0%] 18
All ❌✅ (primary) -3.2% [-6.6%, -1.5%] 70

Binary size

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

Bootstrap: 630.365s -> 630.015s (-0.06%)
Artifact size: 318.00 MiB -> 317.98 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 10, 2023
@cjgillot cjgillot self-assigned this Sep 11, 2023
@Zoxc
Copy link
Contributor Author

Zoxc commented Sep 12, 2023

I included a commit where dep kind counts are also encoded so the index hash maps can get the right initial capacity. That's an additional improvement:

BenchmarkBeforeAfterBeforeAfter
TimeTime%MemoryMemory%
🟣 clap:check:unchanged0.4117s0.4096s -0.49%93.09 MiB92.73 MiB -0.39%
🟣 hyper:check:unchanged0.1233s0.1226s -0.57%47.85 MiB47.81 MiB -0.09%
🟣 regex:check:unchanged0.3025s0.3009s -0.54%71.39 MiB71.05 MiB -0.49%
🟣 syn:check:unchanged0.5760s0.5734s -0.44%101.72 MiB101.55 MiB -0.17%
🟣 syntex_syntax:check:unchanged1.4258s1.4197s -0.43%202.54 MiB202.23 MiB -0.15%
Total2.8392s2.8262s -0.46%516.59 MiB515.37 MiB -0.24%
Summary1.0000s0.9951s -0.49%1 byte1.00 bytes -0.26%

@cjgillot
Copy link
Contributor

@bors try @rust-timer queue

@bors
Copy link
Contributor

bors commented Sep 12, 2023

⌛ Trying commit f8ad88b with merge df14cfe...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 12, 2023
Store a index per dep node kind

This stores an index map per dep node kind instead of using a single index map. This avoids storing `DepKind` in the key for greater cache efficiency.

<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th><td align="right">Memory</td><td align="right">Memory</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:unchanged</td><td align="right">0.4376s</td><td align="right">0.4334s</td><td align="right"> -0.95%</td><td align="right">92.53 MiB</td><td align="right">92.39 MiB</td><td align="right"> -0.15%</td></tr><tr><td>🟣 <b>hyper</b>:check:unchanged</td><td align="right">0.1442s</td><td align="right">0.1446s</td><td align="right"> 0.29%</td><td align="right">47.48 MiB</td><td align="right">47.63 MiB</td><td align="right"> 0.31%</td></tr><tr><td>🟣 <b>regex</b>:check:unchanged</td><td align="right">0.3296s</td><td align="right">0.3261s</td><td align="right">💚  -1.06%</td><td align="right">72.37 MiB</td><td align="right">71.20 MiB</td><td align="right">💚  -1.62%</td></tr><tr><td>🟣 <b>syn</b>:check:unchanged</td><td align="right">0.6149s</td><td align="right">0.6014s</td><td align="right">💚  -2.19%</td><td align="right">105.74 MiB</td><td align="right">101.69 MiB</td><td align="right">💚  -3.83%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:unchanged</td><td align="right">1.4882s</td><td align="right">1.4560s</td><td align="right">💚  -2.16%</td><td align="right">209.75 MiB</td><td align="right">201.46 MiB</td><td align="right">💚  -3.95%</td></tr><tr><td>Total</td><td align="right">3.0144s</td><td align="right">2.9616s</td><td align="right">💚  -1.75%</td><td align="right">527.87 MiB</td><td align="right">514.37 MiB</td><td align="right">💚  -2.56%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9879s</td><td align="right">💚  -1.21%</td><td align="right">1 byte</td><td align="right">0.98 bytes</td><td align="right">💚  -1.85%</td></tr></table>
@bors
Copy link
Contributor

bors commented Sep 12, 2023

☀️ Try build successful - checks-actions
Build commit: df14cfe (df14cfe1d6418344f82966df5d7589e1e8682dda)

@cjgillot
Copy link
Contributor

@rust-timer build df14cfe

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (df14cfe): comparison URL.

Overall result: no relevant changes - no 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.

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

Instruction count

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

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)
3.3% [2.1%, 5.4%] 3
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
-3.1% [-5.7%, -1.4%] 18
Improvements ✅
(secondary)
-3.3% [-4.8%, -1.6%] 6
All ❌✅ (primary) -2.2% [-5.7%, 5.4%] 21

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)
2.6% [0.8%, 3.7%] 6
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.1% [-8.2%, -1.9%] 85
Improvements ✅
(secondary)
-7.4% [-12.1%, -4.1%] 18
All ❌✅ (primary) -3.6% [-8.2%, 3.7%] 91

Binary size

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

Bootstrap: 631.075s -> 631.296s (0.04%)
Artifact size: 317.84 MiB -> 317.84 MiB (0.00%)

@rustbot rustbot removed the perf-regression Performance regression. label Sep 13, 2023
@cjgillot
Copy link
Contributor

Good max-rss and cycles gains.
@bors r+

@bors
Copy link
Contributor

bors commented Sep 16, 2023

📌 Commit f8ad88b 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 Sep 16, 2023
@bors
Copy link
Contributor

bors commented Sep 16, 2023

⌛ Testing commit f8ad88b with merge 3f5a62d...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2023
Store a index per dep node kind

This stores an index map per dep node kind instead of using a single index map. This avoids storing `DepKind` in the key for greater cache efficiency.

<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th><td align="right">Memory</td><td align="right">Memory</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:unchanged</td><td align="right">0.4376s</td><td align="right">0.4334s</td><td align="right"> -0.95%</td><td align="right">92.53 MiB</td><td align="right">92.39 MiB</td><td align="right"> -0.15%</td></tr><tr><td>🟣 <b>hyper</b>:check:unchanged</td><td align="right">0.1442s</td><td align="right">0.1446s</td><td align="right"> 0.29%</td><td align="right">47.48 MiB</td><td align="right">47.63 MiB</td><td align="right"> 0.31%</td></tr><tr><td>🟣 <b>regex</b>:check:unchanged</td><td align="right">0.3296s</td><td align="right">0.3261s</td><td align="right">💚  -1.06%</td><td align="right">72.37 MiB</td><td align="right">71.20 MiB</td><td align="right">💚  -1.62%</td></tr><tr><td>🟣 <b>syn</b>:check:unchanged</td><td align="right">0.6149s</td><td align="right">0.6014s</td><td align="right">💚  -2.19%</td><td align="right">105.74 MiB</td><td align="right">101.69 MiB</td><td align="right">💚  -3.83%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:unchanged</td><td align="right">1.4882s</td><td align="right">1.4560s</td><td align="right">💚  -2.16%</td><td align="right">209.75 MiB</td><td align="right">201.46 MiB</td><td align="right">💚  -3.95%</td></tr><tr><td>Total</td><td align="right">3.0144s</td><td align="right">2.9616s</td><td align="right">💚  -1.75%</td><td align="right">527.87 MiB</td><td align="right">514.37 MiB</td><td align="right">💚  -2.56%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9879s</td><td align="right">💚  -1.21%</td><td align="right">1 byte</td><td align="right">0.98 bytes</td><td align="right">💚  -1.85%</td></tr></table>
@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)
failures:

---- [ui] tests/ui/const-generics/transparent-maybeunit-array-wrapper.rs#min stdout ----

error in revision `min`: test run failed!
status: exit status: 101
command: RUST_TEST_THREADS="8" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/remote-test-client" "run" "0" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/transparent-maybeunit-array-wrapper.min/a"
--- stdout -------------------------------
uploaded "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/transparent-maybeunit-array-wrapper.min/a", waiting for result
--- stderr -------------------------------
thread 'main' panicked at src/tools/remote-test-client/src/main.rs:310:9:
client.read_exact(&mut header) failed with Connection reset by peer (os error 104)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@bors
Copy link
Contributor

bors commented Sep 16, 2023

💔 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 Sep 16, 2023
@Zoxc
Copy link
Contributor Author

Zoxc commented Sep 16, 2023

That looks like a failure to retry.

@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 Sep 16, 2023
@bors
Copy link
Contributor

bors commented Sep 16, 2023

⌛ Testing commit f8ad88b with merge 341ef15...

@bors
Copy link
Contributor

bors commented Sep 16, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 16, 2023
@bors bors merged commit 341ef15 into rust-lang:master Sep 16, 2023
12 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Sep 16, 2023
@Zoxc Zoxc deleted the group-dep-node-kinds branch September 16, 2023 20:31
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (341ef15): 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.4% [0.2%, 0.5%] 9
Regressions ❌
(secondary)
0.3% [0.2%, 0.5%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.2%, 0.5%] 9

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)
4.3% [2.4%, 6.2%] 2
Regressions ❌
(secondary)
2.5% [1.5%, 3.5%] 3
Improvements ✅
(primary)
-2.7% [-5.6%, -0.8%] 23
Improvements ✅
(secondary)
-3.5% [-4.7%, -1.7%] 6
All ❌✅ (primary) -2.1% [-5.6%, 6.2%] 25

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)
-4.2% [-8.1%, -1.4%] 90
Improvements ✅
(secondary)
-7.8% [-13.3%, -4.4%] 18
All ❌✅ (primary) -4.2% [-8.1%, -1.4%] 90

Binary size

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

Bootstrap: 632.183s -> 632.945s (0.12%)
Artifact size: 318.14 MiB -> 318.26 MiB (0.04%)

@rustbot rustbot added the perf-regression Performance regression. label Sep 16, 2023
@Kobzol
Copy link
Contributor

Kobzol commented Sep 16, 2023

The previous run didn't have any instruction count changes, but anyway the Max-RSS and especially cycle wins outweigh the few icount regressions.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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