Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7306f4

Browse files
committed
[libc++] Add a job that runs the benchmarks as part of the CI
This will make it easier to see the performance impact of individual patches. This is a first step towards better performance tracking, but many things still need to be figured out: - We should get a dedicated set of machines to run these tests on - We could probably reuse regularly-generated baseline results published to LNT instead of re-generating the baselines in this job every time.
1 parent 8da3ab1 commit c7306f4

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,25 @@ jobs:
284284
- name: Build and test
285285
run: |
286286
bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
287+
288+
benchmarks:
289+
runs-on: llvm-premerge-libcxx-next-runners # TODO: This should run on a dedicated set of machines
290+
# needs: [ stage3 ] # TODO: Run this at the end of the pipeline once we're done testing the job
291+
steps:
292+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
293+
- name: benchmarks
294+
run: libcxx/utils/ci/run-buildbot benchmark-comparison
295+
env:
296+
CC: clang-22
297+
CXX: clang++-22
298+
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
299+
if: always()
300+
with:
301+
name: benchmarks-results
302+
path: |
303+
**/test-results.xml
304+
**/*.abilist
305+
**/CMakeConfigureLog.yaml
306+
**/CMakeError.log
307+
**/CMakeOutput.log
308+
**/crash_diagnostics/*

libcxx/utils/ci/run-buildbot

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,24 @@ generic-optimized-speed)
542542
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-optimized-speed.cmake"
543543
check-runtimes
544544
;;
545+
benchmark-comparison)
546+
clean
547+
LIT_ARGS="-sv -j1 --param optimization=speed libcxx/test/benchmarks/hash.bench.cpp libcxx/test/benchmarks/join_view.bench.cpp"
548+
549+
baseline_commit=$(git merge-base main HEAD)
550+
step "Building and running the baseline at ${baseline_commit}"
551+
rm -rf "${BUILD_DIR}-baseline"
552+
./libcxx/utils/test-at-commit --commit ${baseline_commit} -B "${BUILD_DIR}-baseline" -- ${LIT_ARGS}
553+
554+
# Build and run the candidate
555+
step "Building and running the candidate"
556+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-optimized-speed.cmake"
557+
./libcxx/utils/libcxx-lit "${BUILD_DIR}" ${LIT_ARGS}
558+
559+
step "Comparison of the baseline and the candidate"
560+
./libcxx/utils/compare-benchmarks <(./libcxx/utils/consolidate-benchmarks "${BUILD_DIR}-baseline") \
561+
<(./libcxx/utils/consolidate-benchmarks "${BUILD_DIR}")
562+
;;
545563
apple-configuration)
546564
clean
547565

0 commit comments

Comments
 (0)