Skip to content

Commit 399dd80

Browse files
committed
Auto merge of rust-lang#95724 - Kobzol:ci-update-rustc-perf, r=nnethercote
CI: update `rustc-perf` version used in CI and also the corresponding PGO benchmarks The old version was from May 2021. The `rustc-perf` benchmarks have seen a significant overhaul recently, so let's see if the new benchmarks can improve PGO performance.
2 parents 4bb685e + 49efa23 commit 399dd80

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
9898
RUN ./build-clang.sh
9999
ENV CC=clang CXX=clang++
100100

101-
ENV PERF_COMMIT 1e19fc4c6168d2f7596e512f42f358f245d8f09d
101+
# rustc-perf version from 2022-04-05
102+
ENV PERF_COMMIT 04fccd80396f954b339c366e30221f4bd52c5e03
102103
RUN curl -LS -o perf.zip https://github.com/rust-lang/rustc-perf/archive/$PERF_COMMIT.zip && \
103104
unzip perf.zip && \
104105
mv rustc-perf-$PERF_COMMIT rustc-perf && \

src/ci/pgo.sh

+12-7
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
set -euxo pipefail
44

55
# Compile several crates to gather execution PGO profiles.
6-
# Arg0 => builds (Debug, Opt)
7-
# Arg1 => runs (Full, IncrFull, All)
6+
# Arg0 => profiles (Debug, Opt)
7+
# Arg1 => scenarios (Full, IncrFull, All)
88
# Arg2 => crates (syn, cargo, ...)
99
gather_profiles () {
1010
cd /checkout/obj
@@ -27,10 +27,10 @@ gather_profiles () {
2727
profile_local \
2828
eprintln \
2929
/checkout/obj/build/$PGO_HOST/stage2/bin/rustc \
30-
Test \
31-
--builds $1 \
30+
--id Test \
31+
--profiles $1 \
3232
--cargo /checkout/obj/build/$PGO_HOST/stage0/bin/cargo \
33-
--runs $2 \
33+
--scenarios $2 \
3434
--include $3
3535

3636
cd /checkout/obj
@@ -64,7 +64,10 @@ RUSTC=/checkout/obj/build/$PGO_HOST/stage0/bin/rustc \
6464
RUSTC_BOOTSTRAP=1 \
6565
/checkout/obj/build/$PGO_HOST/stage0/bin/cargo build -p collector
6666

67-
gather_profiles "Debug,Opt" "Full" "syn,cargo,serde,ripgrep,regex,clap-rs,hyper-2"
67+
# Here we're profiling LLVM, so we only care about `Debug` and `Opt`, because we want to stress
68+
# codegen. We also profile some of the most prolific crates.
69+
gather_profiles "Debug,Opt" "Full" \
70+
"syn-1.0.89,cargo-0.60.0,serde-1.0.136,ripgrep-13.0.0,regex-1.5.5,clap-3.1.6,hyper-0.14.18"
6871

6972
# Merge the profile data we gathered for LLVM
7073
# Note that this uses the profdata from the clang we used to build LLVM,
@@ -83,8 +86,10 @@ python3 ../x.py build --target=$PGO_HOST --host=$PGO_HOST \
8386
--stage 2 library/std \
8487
--rust-profile-generate=/tmp/rustc-pgo
8588

89+
# Here we're profiling the `rustc` frontend, so we also include `Check`.
90+
# The benchmark set includes various stress tests that put the frontend under pressure.
8691
gather_profiles "Check,Debug,Opt" "All" \
87-
"externs,ctfe-stress-4,inflate,cargo,token-stream-stress,match-stress-enum"
92+
"externs,ctfe-stress-4,cargo-0.60.0,token-stream-stress,match-stress,tuple-stress"
8893

8994
# Merge the profile data we gathered
9095
./build/$PGO_HOST/llvm/bin/llvm-profdata \

0 commit comments

Comments
 (0)