-
Notifications
You must be signed in to change notification settings - Fork 12
132 lines (126 loc) · 5.16 KB
/
Copy pathbenchmarks.yml
File metadata and controls
132 lines (126 loc) · 5.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# ------------------------------------------------------------------------------
# Copyright Matt Borland 2026.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------
#
# Runs the Boost.Decimal benchmarks (test/benchmarks.cpp) in release mode on a
# spread of native runners so that performance numbers, and any regressions in
# them, are captured on every run. The benchmark target is a run-fail test that
# always returns non-zero, so b2 reports success and the timing output is read
# back from the captured .output file.
name: Run Benchmarks
on:
push:
branches:
- master
- develop
- feature/**
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
concurrency:
group: ${{ format('{0}:{1}:benchmarks', github.repository, github.ref) }}
cancel-in-progress: true
env:
GIT_FETCH_JOBS: 8
jobs:
linux:
name: Linux GCC ${{ matrix.address_model }}-bit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
address_model: [ 32, 64 ]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y g++-14 g++-14-multilib
- name: Setup Boost
run: |
LIBRARY=${GITHUB_REPOSITORY#*/}
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true
echo "BOOST_BRANCH: $BOOST_BRANCH"
cd ..
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" boost-root
cd boost-root
mkdir -p libs/$LIBRARY
cp -r "$GITHUB_WORKSPACE"/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs $GIT_FETCH_JOBS" $LIBRARY
./bootstrap.sh
./b2 headers
echo "using gcc : : g++-14 ;" > ~/user-config.jam
- name: Run benchmarks (release)
run: |
cd ../boost-root
./b2 -j$(nproc) toolset=gcc cxxstd=20 variant=release address-model=${{ matrix.address_model }} \
define=BOOST_DECIMAL_RUN_BENCHMARKS libs/$LIBRARY/test//benchmarks
echo "==================== Benchmark results (Linux GCC ${{ matrix.address_model }}-bit) ===================="
find bin.v2 -path '*release*' -name 'benchmarks.output' -exec cat {} +
find bin.v2 -path '*release*' -name 'benchmarks.output' -exec cp {} "$GITHUB_WORKSPACE/benchmarks-linux-gcc-${{ matrix.address_model }}-bit.txt" \;
- name: Upload benchmark output
if: always()
uses: actions/upload-artifact@v6
with:
name: benchmarks-linux-gcc-${{ matrix.address_model }}-bit
path: benchmarks-linux-gcc-${{ matrix.address_model }}-bit.txt
if-no-files-found: warn
windows:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows x64 MSVC
os: windows-latest
arch: x64
- name: Windows ARM64 MSVC
os: windows-11-arm
arch: arm64
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v6
- name: Setup Boost
run: |
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
cmd /c bootstrap
b2 -d0 headers
- name: Run benchmarks (release)
run: |
cd ../boost-root
b2 -j3 libs/%LIBRARY%/test//benchmarks toolset=msvc cxxstd=latest address-model=64 variant=release define=BOOST_DECIMAL_RUN_BENCHMARKS embed-manifest-via=linker || exit /b 1
echo ==================== Benchmark results (%RUNNER_OS% %RUNNER_ARCH%) ====================
for /f "delims=" %%f in ('dir /s /b bin.v2\benchmarks.output 2^>nul') do @type "%%f"
for /f "delims=" %%f in ('dir /s /b bin.v2\benchmarks.output 2^>nul') do @copy /y "%%f" "%GITHUB_WORKSPACE%\benchmarks-windows-${{ matrix.arch }}.txt" >nul
exit /b 0
- name: Upload benchmark output
if: always()
uses: actions/upload-artifact@v6
with:
name: benchmarks-windows-${{ matrix.arch }}
path: benchmarks-windows-${{ matrix.arch }}.txt
if-no-files-found: warn