Skip to content

Commit 1097d47

Browse files
committed
Run performance benchmarks as CI job
To guard against performance regressions introduced by changes, run a fixed set (with this commit: the LLBMC benchmark suite) of benchmarks on each pull request.
1 parent d971ad8 commit 1097d47

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

Diff for: .github/workflows/performance.yaml

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Performance benchmarking
2+
3+
on:
4+
pull_request:
5+
branches: [ develop ]
6+
7+
jobs:
8+
run-llbmc-benchmarks:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
submodules: recursive
14+
fetch-depth: 0
15+
- name: Fetch dependencies
16+
env:
17+
# This is needed in addition to -yq to prevent apt-get from asking for
18+
# user input
19+
DEBIAN_FRONTEND: noninteractive
20+
run: |
21+
sudo apt-get install --no-install-recommends -y build-essential flex bison maven ccache
22+
sudo apt-get install --no-install-recommends -y bmt poppler-utils texlive-latex-base texlive-pictures
23+
make -C src minisat2-download
24+
- name: Prepare ccache
25+
uses: actions/cache@v2
26+
with:
27+
path: .ccache
28+
key: ${{ runner.os }}-20.04-make-${{ github.ref }}-${{ github.sha }}-Performance
29+
restore-keys: |
30+
${{ runner.os }}-20.04-make-${{ github.ref }}
31+
${{ runner.os }}-20.04-make
32+
- name: ccache environment
33+
run: |
34+
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
35+
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
36+
- name: Zero ccache stats and limit in size
37+
run: ccache -z --max-size=500M
38+
- name: Build with make
39+
run: |
40+
make -C src CXX='ccache /usr/bin/g++' cbmc.dir goto-cc.dir -j2
41+
mkdir pr-bin
42+
cp src/cbmc/cbmc pr-bin/
43+
cp src/goto-cc/goto-cc pr-bin/
44+
echo "PR_BIN=$PWD/pr-bin" >> $GITHUB_ENV
45+
- name: Build base with make
46+
run: |
47+
git checkout -b ${{ github.ref }}
48+
git checkout ${{ github.base_ref }}
49+
git checkout -b base ${{ github.base_ref }}
50+
make -C src CXX='ccache /usr/bin/g++' cbmc.dir goto-cc.dir -j2
51+
mkdir base-bin
52+
cp src/cbmc/cbmc base-bin/
53+
cp src/goto-cc/goto-cc base-bin/
54+
echo "BASE_BIN=$PWD/base-bin" >> $GITHUB_ENV
55+
- name: Print ccache stats
56+
run: ccache -s
57+
- name: Run LLBMC benchmarks
58+
run: |
59+
git clone --depth=1 https://github.com/tautschnig/bmt.git bmt.git
60+
cd bmt.git/pkgs
61+
tar czf ../llbmc-bench.cprover-bm.tar.gz llbmc-bench
62+
cd ..
63+
cpbm unpack orig-src/llbmc-bench-vstte-2012.tgz llbmc-bench.cprover-bm.tar.gz
64+
cd llbmc-bench
65+
sed -i 's/\(ex36.*\)/\1 --unwind 11/' cprover/cbmc_opts
66+
export PATH=$BASE_BIN:$PATH
67+
cprover/rules -j2 table CONFIG=cbmc.base
68+
export PATH=$PR_BIN:$PATH
69+
cprover/rules -j2 table CONFIG=cbmc.pr
70+
# avoid downloading PGF as we use the Ubuntu package
71+
mkdir -p base pgfplots
72+
cpbm graph -s cprover/results.cbmc.base.csv cprover/results.cbmc.pr.csv
73+
pdftoppm -png results.cbmc.base_results.cbmc.pr-scatter.pdf scatter
74+
- uses: actions/upload-artifact@v2
75+
with:
76+
name: scatter.png
77+
path: bmt.git/llbmc-bench/scatter-1.png
78+
if-no-files-found: error
79+
- name: Compare results
80+
run: |
81+
cd bmt.git/llbmc-bench
82+
cut -d, -f2-6,8-17,19 cprover/results.cbmc.base.csv > base.csv
83+
cut -d, -f2-6,8-17,19 cprover/results.cbmc.pr.csv > pr.csv
84+
diff base.csv pr.csv

0 commit comments

Comments
 (0)