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

[DO NOT MERGE] perf: test rustc-hash variant optimized for small strings. #120093

Closed
wants to merge 1 commit into from
Closed

[DO NOT MERGE] perf: test rustc-hash variant optimized for small strings. #120093

wants to merge 1 commit into from

Conversation

adamreichold
Copy link
Contributor

I would be glad if a perf run could be performed for the modification proposed in rust-lang/rustc-hash#30 which came out of FNV beating fxhash for small strings when used in Tantivy. (Note that this is not changing the structure of rustc-hash, it just tries to optimize the implementation for handling the remaining bytes below the word size which appears to dominate performance for short strings.)

@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2024

r? @wesleywiser

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

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 18, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2024

rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing src/librustdoc/json/conversions.rs; otherwise, make sure you bump the FORMAT_VERSION constant.

cc @CraftSpider, @aDotInTheVoid, @Enselic, @obi1kenobi

Some changes might have occurred in exhaustiveness checking

cc @Nadrieril

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

@rust-log-analyzer

This comment has been minimized.

@Nadrieril
Copy link
Member

You'll need to run ./x.py check to update Cargo.lock

@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2024

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.

@rust-log-analyzer

This comment has been minimized.

@Nadrieril
Copy link
Member

I guess tidy doesn't like git dependencies. I checked it and it looks sane, maybe bors will allow it?

@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 Jan 18, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 18, 2024
…s, r=<try>

[DO NOT MERGE] perf: test rustc-hash variant optimized for small strings.

I would be glad if a perf run could be performed for the modification proposed in rust-lang/rustc-hash#30 which came out of FNV beating fxhash for small strings when used in Tantivy. (Note that this is not changing the structure of rustc-hash, it just tries to optimize the implementation for handling the remaining bytes below the word size which appears to dominate performance for short strings.)
@bors
Copy link
Contributor

bors commented Jan 18, 2024

⌛ Trying commit b2f1037 with merge 255c8f5...

@adamreichold
Copy link
Contributor Author

I guess tidy doesn't like git dependencies. I checked it and it looks sane, maybe bors will allow it?

Thank you! I could also force-push an amended version which also updates tidy's ALLOWED_SOURCES list to include my fork of rustc-hash by I guess there is no point if the benchmarks will run without that as this is not aiming for a green CI in any case.

@Nadrieril
Copy link
Member

Oh yeah that would have been a saner solution x) Bors seems happy though, let's see what happens

@Noratrieb
Copy link
Member

bors doesn't care about such lowly things as "tidy" or "code quality", it's fine

@bors
Copy link
Contributor

bors commented Jan 18, 2024

☀️ Try build successful - checks-actions
Build commit: 255c8f5 (255c8f55da083350814df0d15a9506a4ba6f42f8)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (255c8f5): 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)
- - 0
Regressions ❌
(secondary)
0.5% [0.2%, 0.7%] 11
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

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

Cycles

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

Binary size

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

Bootstrap: 665.735s -> 665.203s (-0.08%)
Artifact size: 308.27 MiB -> 308.34 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 Jan 18, 2024
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jan 18, 2024
@lnicola
Copy link
Member

lnicola commented Jan 18, 2024

Can I do this?

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@adamreichold
Copy link
Contributor Author

adamreichold commented Jan 18, 2024

@Nilstrieb @Nadrieril It seems merging the hash rounds for 4, 2 and 1 remaining bytes decreases quality too much and hence yields regressions in rustc's benchmarks. The one regression mentioned in rust-lang/rustc-hash#30 which is most likely also due to this can be fixed by merging only the rounds for 2 and 1 remaining bytes but keeping the separate round for 4 remaining bytes as now proposed. Sadly, this again makes the resulting hash slower than FNV for very short strings so it does not really seem to solve the original problem. Could one of you nevertheless retrigger the perf run to verify that this understanding is correct? Sorry for wasting CI time and thank you!

@bors
Copy link
Contributor

bors commented Jan 18, 2024

⌛ Trying commit 120f4b2 with merge 376db7f...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 18, 2024
…s, r=<try>

[DO NOT MERGE] perf: test rustc-hash variant optimized for small strings.

I would be glad if a perf run could be performed for the modification proposed in rust-lang/rustc-hash#30 which came out of FNV beating fxhash for small strings when used in Tantivy. (Note that this is not changing the structure of rustc-hash, it just tries to optimize the implementation for handling the remaining bytes below the word size which appears to dominate performance for short strings.)
@Nadrieril
Copy link
Member

Funny that you'd have bors perms but not rust-timer perms, ask on Zulip for them if you want.

I think we need a different invocation if we're not doing the combined bors+timer command. Let's see

@rust-timer queue 376db7f

@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 Jan 18, 2024
@lnicola
Copy link
Member

lnicola commented Jan 18, 2024

Funny that you'd have bors perms but not rust-timer perms, ask on Zulip for them if you want.

Yeah, that's so I can self-approve rust-analyzer sync PRs, but I'm probably not supposed to r+ anything else.

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=adamreichold
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_cfe48645-a410-4b5f-be2d-cdfffbea5fd7
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=0b87b35b44a081bc1559ed664cf1a8dea58bc1fc
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_cfe48645-a410-4b5f-be2d-cdfffbea5fd7
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_cfe48645-a410-4b5f-be2d-cdfffbea5fd7
GITHUB_TRIGGERING_ACTOR=adamreichold
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/120093/merge
GITHUB_WORKFLOW_SHA=0b87b35b44a081bc1559ed664cf1a8dea58bc1fc
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
Built container sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Looks like docker image is the same as before, not uploading
https://ci-caches.rust-lang.org/docker/7ebc15c01a233894034d277c8cce4e949f4e7791f66b4727c8fb6e058a0b8171d6152e1441d677cef0653843ceeee469c097b8699b2bb74249e674f6aa1a8813
sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
  local time: Thu Jan 18 19:33:27 UTC 2024
  network time: Thu, 18 Jan 2024 19:33:27 GMT
  network time: Thu, 18 Jan 2024 19:33:27 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---
##[endgroup]
Skipping Set({test::src/tools/tidy}) because it is excluded
##[group]Building stage0 library artifacts (x86_64-unknown-linux-gnu)
    Updating crates.io index
    Updating git repository `https://github.com/adamreichold/rustc-hash.git`
---
   Compiling rustc_arena v0.0.0 (/checkout/compiler/rustc_arena)
   Compiling itertools v0.11.0
   Compiling elsa v1.7.1
   Compiling cpufeatures v0.2.8
   Compiling rustc-hash v2.0.0 (https://github.com/adamreichold/rustc-hash.git?branch=small-strings#6f0afc12)
   Compiling psm v0.1.21
   Compiling stacker v0.1.15
   Compiling rustc_graphviz v0.0.0 (/checkout/compiler/rustc_graphviz)
   Compiling scoped-tls v1.0.1
---
   Compiling hashbrown v0.14.3
   Compiling itertools v0.11.0
   Compiling elsa v1.7.1
   Compiling cpufeatures v0.2.8
   Compiling rustc-hash v2.0.0 (https://github.com/adamreichold/rustc-hash.git?branch=small-strings#6f0afc12)
   Compiling crossbeam-deque v0.8.3
   Compiling unicode-width v0.1.11
   Compiling rustc_graphviz v0.0.0 (/checkout/compiler/rustc_graphviz)
   Compiling scoped-tls v1.0.1
---

---- [ui] tests/ui/stats/hir-stats.rs stdout ----
diff of stderr:

8 ast-stats-1 WherePredicate            56 ( 0.9%)             1            56
9 ast-stats-1 - BoundPredicate            56 ( 0.9%)             1
10 ast-stats-1 Attribute                 64 ( 1.0%)             2            32
- ast-stats-1 - Normal                    32 ( 0.5%)             1
12 ast-stats-1 - DocComment                32 ( 0.5%)             1
+ ast-stats-1 - Normal                    32 ( 0.5%)             1
13 ast-stats-1 Local                     72 ( 1.1%)             1            72
- ast-stats-1 Arm                       96 ( 1.5%)             2            48
15 ast-stats-1 ForeignItem               96 ( 1.5%)             1            96
16 ast-stats-1 - Fn                        96 ( 1.5%)             1
+ ast-stats-1 Arm                       96 ( 1.5%)             2            48
17 ast-stats-1 FnDecl                   120 ( 1.8%)             5            24
18 ast-stats-1 FieldDef                 160 ( 2.4%)             2            80
19 ast-stats-1 Stmt                     160 ( 2.4%)             5            32

26 ast-stats-1 GenericBound             288 ( 4.4%)             4            72
27 ast-stats-1 - Trait                    288 ( 4.4%)             4
28 ast-stats-1 AssocItem                352 ( 5.4%)             4            88
- ast-stats-1 - Type                     176 ( 2.7%)             2
30 ast-stats-1 - Fn                       176 ( 2.7%)             2
+ ast-stats-1 - Type                     176 ( 2.7%)             2
31 ast-stats-1 GenericParam             480 ( 7.3%)             5            96
32 ast-stats-1 Pat                      504 ( 7.7%)             7            72
- ast-stats-1 - Struct                    72 ( 1.1%)             1
34 ast-stats-1 - Wild                      72 ( 1.1%)             1
+ ast-stats-1 - Struct                    72 ( 1.1%)             1
35 ast-stats-1 - Ident                    360 ( 5.5%)             5
36 ast-stats-1 Expr                     576 ( 8.8%)             8            72
37 ast-stats-1 - Path                      72 ( 1.1%)             1

- ast-stats-1 - Match                     72 ( 1.1%)             1
39 ast-stats-1 - Struct                    72 ( 1.1%)             1
+ ast-stats-1 - Match                     72 ( 1.1%)             1
40 ast-stats-1 - Lit                      144 ( 2.2%)             2
41 ast-stats-1 - Block                    216 ( 3.3%)             3
42 ast-stats-1 PathSegment              720 (11.0%)            30            24

43 ast-stats-1 Ty                       896 (13.7%)            14            64
- ast-stats-1 - Ptr                       64 ( 1.0%)             1
45 ast-stats-1 - Ref                       64 ( 1.0%)             1
+ ast-stats-1 - Ptr                       64 ( 1.0%)             1
46 ast-stats-1 - ImplicitSelf             128 ( 2.0%)             2
47 ast-stats-1 - Path                     640 ( 9.8%)            10
48 ast-stats-1 Item                   1_224 (18.7%)             9           136

- ast-stats-1 - Trait                    136 ( 2.1%)             1
50 ast-stats-1 - Enum                     136 ( 2.1%)             1
- ast-stats-1 - ForeignMod               136 ( 2.1%)             1
52 ast-stats-1 - Impl                     136 ( 2.1%)             1
+ ast-stats-1 - ForeignMod               136 ( 2.1%)             1
+ ast-stats-1 - Trait                    136 ( 2.1%)             1
53 ast-stats-1 - Fn                       272 ( 4.2%)             2
54 ast-stats-1 - Use                      408 ( 6.2%)             3
55 ast-stats-1 ----------------------------------------------------------------

65 ast-stats-2 WherePredicate            56 ( 0.8%)             1            56
66 ast-stats-2 - BoundPredicate            56 ( 0.8%)             1
67 ast-stats-2 Local                     72 ( 1.0%)             1            72
- ast-stats-2 Arm                       96 ( 1.3%)             2            48
69 ast-stats-2 ForeignItem               96 ( 1.3%)             1            96
70 ast-stats-2 - Fn                        96 ( 1.3%)             1
- ast-stats-2 InlineAsm                120 ( 1.7%)             1           120
+ ast-stats-2 Arm                       96 ( 1.3%)             2            48
72 ast-stats-2 FnDecl                   120 ( 1.7%)             5            24
+ ast-stats-2 InlineAsm                120 ( 1.7%)             1           120
73 ast-stats-2 Attribute                128 ( 1.8%)             4            32
74 ast-stats-2 - DocComment                32 ( 0.4%)             1
75 ast-stats-2 - Normal                    96 ( 1.3%)             3

76 ast-stats-2 FieldDef                 160 ( 2.2%)             2            80
77 ast-stats-2 Stmt                     160 ( 2.2%)             5            32
- ast-stats-2 - Local                     32 ( 0.4%)             1
79 ast-stats-2 - Semi                      32 ( 0.4%)             1
+ ast-stats-2 - Local                     32 ( 0.4%)             1
80 ast-stats-2 - Expr                      96 ( 1.3%)             3
81 ast-stats-2 Param                    160 ( 2.2%)             4            40
82 ast-stats-2 Block                    192 ( 2.7%)             6            32

84 ast-stats-2 GenericBound             288 ( 4.0%)             4            72
85 ast-stats-2 - Trait                    288 ( 4.0%)             4
86 ast-stats-2 AssocItem                352 ( 4.9%)             4            88
- ast-stats-2 - Type                     176 ( 2.5%)             2
88 ast-stats-2 - Fn                       176 ( 2.5%)             2
+ ast-stats-2 - Type                     176 ( 2.5%)             2
89 ast-stats-2 GenericParam             480 ( 6.7%)             5            96
90 ast-stats-2 Pat                      504 ( 7.0%)             7            72
- ast-stats-2 - Struct                    72 ( 1.0%)             1
92 ast-stats-2 - Wild                      72 ( 1.0%)             1
+ ast-stats-2 - Struct                    72 ( 1.0%)             1
93 ast-stats-2 - Ident                    360 ( 5.0%)             5
94 ast-stats-2 Expr                     648 ( 9.1%)             9            72
95 ast-stats-2 - Path                      72 ( 1.0%)             1

- ast-stats-2 - Match                     72 ( 1.0%)             1
- ast-stats-2 - Struct                    72 ( 1.0%)             1
98 ast-stats-2 - InlineAsm                 72 ( 1.0%)             1
+ ast-stats-2 - Struct                    72 ( 1.0%)             1
+ ast-stats-2 - Match                     72 ( 1.0%)             1
99 ast-stats-2 - Lit                      144 ( 2.0%)             2
100 ast-stats-2 - Block                    216 ( 3.0%)             3
101 ast-stats-2 PathSegment              792 (11.1%)            33            24

102 ast-stats-2 Ty                       896 (12.5%)            14            64
- ast-stats-2 - Ptr                       64 ( 0.9%)             1
104 ast-stats-2 - Ref                       64 ( 0.9%)             1
+ ast-stats-2 - Ptr                       64 ( 0.9%)             1
105 ast-stats-2 - ImplicitSelf             128 ( 1.8%)             2
106 ast-stats-2 - Path                     640 ( 8.9%)            10
107 ast-stats-2 Item                   1_496 (20.9%)            11           136

- ast-stats-2 - Trait                    136 ( 1.9%)             1
109 ast-stats-2 - Enum                     136 ( 1.9%)             1
+ ast-stats-2 - Impl                     136 ( 1.9%)             1
110 ast-stats-2 - ExternCrate              136 ( 1.9%)             1
111 ast-stats-2 - ForeignMod               136 ( 1.9%)             1
- ast-stats-2 - Impl                     136 ( 1.9%)             1
+ ast-stats-2 - Trait                    136 ( 1.9%)             1
113 ast-stats-2 - Fn                       272 ( 3.8%)             2
114 ast-stats-2 - Use                      544 ( 7.6%)             4
115 ast-stats-2 ----------------------------------------------------------------

123 hir-stats Mod                       32 ( 0.4%)             1            32
124 hir-stats ExprField                 40 ( 0.4%)             1            40
125 hir-stats TraitItemRef              56 ( 0.6%)             2            28
- hir-stats Local                     64 ( 0.7%)             1            64
127 hir-stats Param                     64 ( 0.7%)             2            32
- hir-stats Body                      72 ( 0.8%)             3            24
- hir-stats InlineAsm                 72 ( 0.8%)             1            72
+ hir-stats Local                     64 ( 0.7%)             1            64
130 hir-stats ImplItemRef               72 ( 0.8%)             2            36
+ hir-stats InlineAsm                 72 ( 0.8%)             1            72
+ hir-stats Body                      72 ( 0.8%)             3            24
131 hir-stats Arm                       80 ( 0.9%)             2            40
132 hir-stats FieldDef                  96 ( 1.1%)             2            48
133 hir-stats Stmt                      96 ( 1.1%)             3            32

- hir-stats - Local                     32 ( 0.4%)             1
135 hir-stats - Semi                      32 ( 0.4%)             1
+ hir-stats - Local                     32 ( 0.4%)             1
136 hir-stats - Expr                      32 ( 0.4%)             1
137 hir-stats FnDecl                   120 ( 1.3%)             3            40
138 hir-stats Attribute                128 ( 1.4%)             4            32

157 hir-stats - Ref                       48 ( 0.5%)             1
158 hir-stats - Path                     624 ( 6.9%)            13
159 hir-stats Expr                     768 ( 8.4%)            12            64
- hir-stats - Path                      64 ( 0.7%)             1
- hir-stats - Struct                    64 ( 0.7%)             1
162 hir-stats - Match                     64 ( 0.7%)             1
+ hir-stats - Path                      64 ( 0.7%)             1
163 hir-stats - InlineAsm                 64 ( 0.7%)             1
+ hir-stats - Struct                    64 ( 0.7%)             1
164 hir-stats - Lit                      128 ( 1.4%)             2
165 hir-stats - Block                    384 ( 4.2%)             6
166 hir-stats Item                     968 (10.6%)            11            88

- hir-stats - Trait                     88 ( 1.0%)             1
168 hir-stats - Enum                      88 ( 1.0%)             1
+ hir-stats - Impl                      88 ( 1.0%)             1
169 hir-stats - ExternCrate               88 ( 1.0%)             1
170 hir-stats - ForeignMod                88 ( 1.0%)             1
- hir-stats - Impl                      88 ( 1.0%)             1
+ hir-stats - Trait                     88 ( 1.0%)             1
172 hir-stats - Fn                       176 ( 1.9%)             2
173 hir-stats - Use                      352 ( 3.9%)             4
174 hir-stats Path                   1_240 (13.6%)            31            40

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/stats/hir-stats/hir-stats.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args stats/hir-stats.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/stats/hir-stats.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/stats/hir-stats" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/stats/hir-stats/auxiliary" "-Zhir-stats"
--- stderr -------------------------------
--- stderr -------------------------------
ast-stats-1 PRE EXPANSION AST STATS
ast-stats-1 Name                Accumulated Size         Count     Item Size
ast-stats-1 ----------------------------------------------------------------
ast-stats-1 GenericArgs               40 ( 0.6%)             1            40
ast-stats-1 - AngleBracketed            40 ( 0.6%)             1
ast-stats-1 Crate                     40 ( 0.6%)             1            40
ast-stats-1 ExprField                 48 ( 0.7%)             1            48
ast-stats-1 WherePredicate            56 ( 0.9%)             1            56
ast-stats-1 - BoundPredicate            56 ( 0.9%)             1
ast-stats-1 Attribute                 64 ( 1.0%)             2            32
ast-stats-1 - DocComment                32 ( 0.5%)             1
ast-stats-1 - Normal                    32 ( 0.5%)             1
ast-stats-1 Local                     72 ( 1.1%)             1            72
ast-stats-1 ForeignItem               96 ( 1.5%)             1            96
ast-stats-1 - Fn                        96 ( 1.5%)             1
ast-stats-1 Arm                       96 ( 1.5%)             2            48
ast-stats-1 FnDecl                   120 ( 1.8%)             5            24
ast-stats-1 FieldDef                 160 ( 2.4%)             2            80
ast-stats-1 Stmt                     160 ( 2.4%)             5            32
ast-stats-1 - Local                     32 ( 0.5%)             1
ast-stats-1 - MacCall                   32 ( 0.5%)             1
ast-stats-1 - Expr                      96 ( 1.5%)             3
ast-stats-1 Param                    160 ( 2.4%)             4            40
ast-stats-1 Block                    192 ( 2.9%)             6            32
ast-stats-1 Variant                  208 ( 3.2%)             2           104
ast-stats-1 GenericBound             288 ( 4.4%)             4            72
ast-stats-1 - Trait                    288 ( 4.4%)             4
ast-stats-1 AssocItem                352 ( 5.4%)             4            88
ast-stats-1 - Fn                       176 ( 2.7%)             2
ast-stats-1 - Type                     176 ( 2.7%)             2
ast-stats-1 GenericParam             480 ( 7.3%)             5            96
ast-stats-1 Pat                      504 ( 7.7%)             7            72
ast-stats-1 - Wild                      72 ( 1.1%)             1
ast-stats-1 - Struct                    72 ( 1.1%)             1
ast-stats-1 - Ident                    360 ( 5.5%)             5
ast-stats-1 Expr                     576 ( 8.8%)             8            72
ast-stats-1 - Path                      72 ( 1.1%)             1
ast-stats-1 - Struct                    72 ( 1.1%)             1
ast-stats-1 - Match                     72 ( 1.1%)             1
ast-stats-1 - Lit                      144 ( 2.2%)             2
ast-stats-1 - Block                    216 ( 3.3%)             3
ast-stats-1 PathSegment              720 (11.0%)            30            24
ast-stats-1 Ty                       896 (13.7%)            14            64
ast-stats-1 - Ref                       64 ( 1.0%)             1
ast-stats-1 - Ptr                       64 ( 1.0%)             1
ast-stats-1 - ImplicitSelf             128 ( 2.0%)             2
ast-stats-1 - Path                     640 ( 9.8%)            10
ast-stats-1 Item                   1_224 (18.7%)             9           136
ast-stats-1 - Enum                     136 ( 2.1%)             1
ast-stats-1 - Impl                     136 ( 2.1%)             1
ast-stats-1 - ForeignMod               136 ( 2.1%)             1
ast-stats-1 - Trait                    136 ( 2.1%)             1
ast-stats-1 - Fn                       272 ( 4.2%)             2
ast-stats-1 - Use                      408 ( 6.2%)             3
ast-stats-1 ----------------------------------------------------------------
ast-stats-1 Total                  6_552
ast-stats-1
ast-stats-2 POST EXPANSION AST STATS
ast-stats-2 Name                Accumulated Size         Count     Item Size
ast-stats-2 ----------------------------------------------------------------
ast-stats-2 GenericArgs               40 ( 0.6%)             1            40
ast-stats-2 - AngleBracketed            40 ( 0.6%)             1
ast-stats-2 Crate                     40 ( 0.6%)             1            40
ast-stats-2 ExprField                 48 ( 0.7%)             1            48
ast-stats-2 WherePredicate            56 ( 0.8%)             1            56
ast-stats-2 - BoundPredicate            56 ( 0.8%)             1
ast-stats-2 Local                     72 ( 1.0%)             1            72
ast-stats-2 ForeignItem               96 ( 1.3%)             1            96
ast-stats-2 - Fn                        96 ( 1.3%)             1
ast-stats-2 Arm                       96 ( 1.3%)             2            48
ast-stats-2 FnDecl                   120 ( 1.7%)             5            24
ast-stats-2 InlineAsm                120 ( 1.7%)             1           120
ast-stats-2 Attribute                128 ( 1.8%)             4            32
ast-stats-2 - DocComment                32 ( 0.4%)             1
ast-stats-2 - Normal                    96 ( 1.3%)             3
ast-stats-2 FieldDef                 160 ( 2.2%)             2            80
ast-stats-2 Stmt                     160 ( 2.2%)             5            32
ast-stats-2 - Semi                      32 ( 0.4%)             1
ast-stats-2 - Local                     32 ( 0.4%)             1
ast-stats-2 - Expr                      96 ( 1.3%)             3
ast-stats-2 Param                    160 ( 2.2%)             4            40
ast-stats-2 Block                    192 ( 2.7%)             6            32
ast-stats-2 Variant                  208 ( 2.9%)             2           104
ast-stats-2 GenericBound             288 ( 4.0%)             4            72
ast-stats-2 - Trait                    288 ( 4.0%)             4
ast-stats-2 AssocItem                352 ( 4.9%)             4            88
ast-stats-2 - Fn                       176 ( 2.5%)             2
ast-stats-2 - Type                     176 ( 2.5%)             2
ast-stats-2 GenericParam             480 ( 6.7%)             5            96
ast-stats-2 Pat                      504 ( 7.0%)             7            72
ast-stats-2 - Wild                      72 ( 1.0%)             1
ast-stats-2 - Struct                    72 ( 1.0%)             1
ast-stats-2 - Ident                    360 ( 5.0%)             5
ast-stats-2 Expr                     648 ( 9.1%)             9            72
ast-stats-2 - Path                      72 ( 1.0%)             1
ast-stats-2 - InlineAsm                 72 ( 1.0%)             1
ast-stats-2 - Struct                    72 ( 1.0%)             1
ast-stats-2 - Match                     72 ( 1.0%)             1
ast-stats-2 - Lit                      144 ( 2.0%)             2
ast-stats-2 - Block                    216 ( 3.0%)             3
ast-stats-2 PathSegment              792 (11.1%)            33            24
ast-stats-2 Ty                       896 (12.5%)            14            64
ast-stats-2 - Ref                       64 ( 0.9%)             1
ast-stats-2 - Ptr                       64 ( 0.9%)             1
ast-stats-2 - ImplicitSelf             128 ( 1.8%)             2
ast-stats-2 - Path                     640 ( 8.9%)            10
ast-stats-2 Item                   1_496 (20.9%)            11           136
ast-stats-2 - Enum                     136 ( 1.9%)             1
ast-stats-2 - Impl                     136 ( 1.9%)             1
ast-stats-2 - ExternCrate              136 ( 1.9%)             1
ast-stats-2 - ForeignMod               136 ( 1.9%)             1
ast-stats-2 - Trait                    136 ( 1.9%)             1
ast-stats-2 - Fn                       272 ( 3.8%)             2
ast-stats-2 - Use                      544 ( 7.6%)             4
ast-stats-2 ----------------------------------------------------------------
ast-stats-2 Total                  7_152
hir-stats HIR STATS
hir-stats Name                Accumulated Size         Count     Item Size
hir-stats ----------------------------------------------------------------
hir-stats ----------------------------------------------------------------
hir-stats ForeignItemRef            24 ( 0.3%)             1            24
hir-stats Lifetime                  24 ( 0.3%)             1            24
hir-stats Mod                       32 ( 0.4%)             1            32
hir-stats ExprField                 40 ( 0.4%)             1            40
hir-stats TraitItemRef              56 ( 0.6%)             2            28
hir-stats Param                     64 ( 0.7%)             2            32
hir-stats Local                     64 ( 0.7%)             1            64
hir-stats ImplItemRef               72 ( 0.8%)             2            36
hir-stats InlineAsm                 72 ( 0.8%)             1            72
hir-stats Body                      72 ( 0.8%)             3            24
hir-stats Arm                       80 ( 0.9%)             2            40
hir-stats FieldDef                  96 ( 1.1%)             2            48
hir-stats Stmt                      96 ( 1.1%)             3            32
hir-stats - Semi                      32 ( 0.4%)             1
hir-stats - Local                     32 ( 0.4%)             1
hir-stats - Expr                      32 ( 0.4%)             1
hir-stats FnDecl                   120 ( 1.3%)             3            40
hir-stats Attribute                128 ( 1.4%)             4            32
hir-stats GenericArg               128 ( 1.4%)             4            32
hir-stats - Type                      32 ( 0.4%)             1
hir-stats - Lifetime                  96 ( 1.1%)             3
hir-stats GenericArgs              144 ( 1.6%)             3            48
hir-stats Variant                  176 ( 1.9%)             2            88
hir-stats GenericBound             192 ( 2.1%)             4            48
hir-stats - Trait                    192 ( 2.1%)             4
hir-stats WherePredicate           192 ( 2.1%)             3            64
hir-stats - BoundPredicate           192 ( 2.1%)             3
hir-stats Block                    288 ( 3.2%)             6            48
hir-stats Pat                      360 ( 4.0%)             5            72
hir-stats - Wild                      72 ( 0.8%)             1
hir-stats - Struct                    72 ( 0.8%)             1
hir-stats - Binding                  216 ( 2.4%)             3
hir-stats GenericParam             400 ( 4.4%)             5            80
hir-stats Generics                 560 ( 6.2%)            10            56
hir-stats Ty                       720 ( 7.9%)            15            48
hir-stats - Ptr                       48 ( 0.5%)             1
hir-stats - Ref                       48 ( 0.5%)             1
hir-stats - Path                     624 ( 6.9%)            13
hir-stats Expr                     768 ( 8.4%)            12            64
hir-stats - Match                     64 ( 0.7%)             1
hir-stats - Path                      64 ( 0.7%)             1
hir-stats - InlineAsm                 64 ( 0.7%)             1
hir-stats - Struct                    64 ( 0.7%)             1
hir-stats - Lit                      128 ( 1.4%)             2
hir-stats - Block                    384 ( 4.2%)             6
hir-stats Item                     968 (10.6%)            11            88
hir-stats - Enum                      88 ( 1.0%)             1
hir-stats - Impl                      88 ( 1.0%)             1
hir-stats - ExternCrate               88 ( 1.0%)             1
hir-stats - ForeignMod                88 ( 1.0%)             1
hir-stats - Trait                     88 ( 1.0%)             1
hir-stats - Fn                       176 ( 1.9%)             2
hir-stats - Use                      352 ( 3.9%)             4
hir-stats Path                   1_240 (13.6%)            31            40
hir-stats PathSegment            1_920 (21.1%)            40            48
hir-stats ----------------------------------------------------------------
hir-stats
------------------------------------------


@Kobzol
Copy link
Contributor

Kobzol commented Jan 18, 2024

@Nadrieril To benchmark an existing merge commit, it's <timer> build <sha>. To queue a benchmark after a try run finishes, it's <timer> queue. I know, confusing :D

@Nadrieril
Copy link
Member

Nadrieril commented Jan 18, 2024

Ah, I can't queue a given SHA? Do you think this'll work anyway?

@Noratrieb
Copy link
Member

Noratrieb commented Jan 18, 2024

I profiled coercions IncrUnchanged on your first run using the linked cachegrind command and go the following result as the most significant change in instruction counts, ignoring some inlining noise on top:

3,147,944 <rustc_span::symbol::Symbol>::intern

That is precisely where I expected this PR to have an impact, so it's fair to say that for the workload of rustc, the first change decreased performance (but in a way that doesn't matter for most not-stress-test workloads).

(The reason why I'm posting this detailed analysis is that rustc-perf can be noisy sometimes, and it's important to take a closer look like I just did)

@Kobzol
Copy link
Contributor

Kobzol commented Jan 18, 2024

Ah, I can't queue a given SHA? Do you think this'll work anyway?

You can, but the command is build <sha>, not queue :D (and it mustn't have been already benchmarked before)

@bors
Copy link
Contributor

bors commented Jan 18, 2024

☀️ Try build successful - checks-actions
Build commit: 376db7f (376db7f5f3c77f049547dc548ca04ed243a38481)

@rust-timer

This comment has been minimized.

@WaffleLapkin
Copy link
Member

@Kobzol if it's confusing, can we add documentation to rustc dev guide? cause it currently doesn't mention build (and the documentation linked there is too verbose)

Ideally a table/cheat sheet with do this [command], if you want [that] could be added (there or somewhere else).

@Kobzol
Copy link
Contributor

Kobzol commented Jan 18, 2024

It's documented in the help page of perf: https://perf.rust-lang.org/help.html Should I also add it to the guide? Or maybe link to the help page there?

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (376db7f): 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)
- - 0
Regressions ❌
(secondary)
0.5% [0.2%, 0.6%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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)
4.6% [4.6%, 4.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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

Bootstrap: 665.206s -> 665.092s (-0.02%)
Artifact size: 308.34 MiB -> 308.36 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 18, 2024
@WaffleLapkin
Copy link
Member

@Kobzol nice! yes, I think it's worth linking in the rustc dev guide

@adamreichold
Copy link
Contributor Author

Ok, so I guess this means that just scheduling changes to the tail part of fxhash will not help as fxhash really needs to extra rounds for quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc 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