|
| 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 | + cp .github/workflows/performance-compare.py pr-bin/ |
| 45 | + echo "PR_BIN=$PWD/pr-bin" >> $GITHUB_ENV |
| 46 | + - name: Build base with make |
| 47 | + run: | |
| 48 | + git checkout -b ${{ github.ref }} |
| 49 | + git checkout ${{ github.base_ref }} |
| 50 | + git checkout -b base ${{ github.base_ref }} |
| 51 | + make -C src CXX='ccache /usr/bin/g++' cbmc.dir goto-cc.dir -j2 |
| 52 | + mkdir base-bin |
| 53 | + cp src/cbmc/cbmc base-bin/ |
| 54 | + cp src/goto-cc/goto-cc base-bin/ |
| 55 | + echo "BASE_BIN=$PWD/base-bin" >> $GITHUB_ENV |
| 56 | + - name: Print ccache stats |
| 57 | + run: ccache -s |
| 58 | + - name: Run LLBMC benchmarks |
| 59 | + run: | |
| 60 | + git clone --depth=1 https://github.com/tautschnig/bmt.git bmt.git |
| 61 | + cd bmt.git/pkgs |
| 62 | + tar czf ../llbmc-bench.cprover-bm.tar.gz llbmc-bench |
| 63 | + cd .. |
| 64 | + cpbm unpack orig-src/llbmc-bench-vstte-2012.tgz llbmc-bench.cprover-bm.tar.gz |
| 65 | + cd llbmc-bench |
| 66 | + sed -i 's/\(ex36.*\)/\1 --unwind 11/' cprover/cbmc_opts |
| 67 | + export PATH=$BASE_BIN:$PATH |
| 68 | + cprover/rules -j2 table CONFIG=cbmc.base |
| 69 | + export PATH=$PR_BIN:$PATH |
| 70 | + rm -rf build |
| 71 | + cprover/rules -j2 table CONFIG=cbmc.pr |
| 72 | + # avoid downloading PGF as we use the Ubuntu package |
| 73 | + mkdir -p base pgfplots |
| 74 | + cpbm graph -s cprover/results.cbmc.base.csv cprover/results.cbmc.pr.csv |
| 75 | + pdftoppm -png results.cbmc.base_results.cbmc.pr-scatter.pdf scatter |
| 76 | + - uses: actions/upload-artifact@v2 |
| 77 | + with: |
| 78 | + name: scatter.png |
| 79 | + path: bmt.git/llbmc-bench/scatter-1.png |
| 80 | + if-no-files-found: error |
| 81 | + - name: Compare results |
| 82 | + run: | |
| 83 | + cd bmt.git/llbmc-bench |
| 84 | + cut -d, -f2,3,5,10,13,17 cprover/results.cbmc.base.csv > base.csv |
| 85 | + cut -d, -f2,3,5,10,13,17 cprover/results.cbmc.pr.csv > pr.csv |
| 86 | + $PR_BIN/performance-compare.py base.csv pr.csv |
0 commit comments