Open bitbacchus opened 3 years ago
For completeness, here is the yml
file I use:
name: benchmark
on:
push:
branches:
- dev
- master
- benchmark
# paths:
# - 'src/**'
# - 'R**'
# workflow_dispatch:
jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
container: rocker/r-ubuntu:18.04
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- name: Install prerequisites
run: |
apt-get update -y
apt-get install -y qt5-qmake
R -e 'install.packages(c("Rcpp", "RInside", "remotes"))'
# the R package of spectre works fine with RcppProgress from CRAN, but here we need some extra functionality
R -e 'remotes::install_github("bitbacchus/rcpp_progress")'
- uses: actions/checkout@v2
- name: Build and run benchmarks with Catch2
run: |
cd spectre_rcpp_dev/benchmark
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake
make
cd ../../
./spectre_rcpp_dev/benchmark/benchmark | tee benchmark_result.txt
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v1
with:
path: ./cache
key: ${{ runner.os }}-benchmark
# Run `github-action-benchmark` action
- name: Store benchmark result
#uses: rhysd/github-action-benchmark@v1
uses: leoholz/github-action-benchmark@v1 # until PR #38 is merged
with:
# What benchmark tool the benchmark_result.txt came from
name: Spectre Benchmark
tool: 'catch2'
output-file-path: benchmark_result.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: "150%"
comment-on-alert: true
fail-on-alert: false
alert-comment-cc-users: "@bitbacchus"
I can reproduce this now. This happens whenever the string for the BENCHMARK name in Catch2 is longer than 35 characters, i.e
TEST_CASE("Fibonacci") {
// now let's benchmark:
BENCHMARK("test1234567890test1234567890test123") { return fib(10); };
}
works, but
TEST_CASE("Fibonacci") {
// now let's benchmark:
BENCHMARK("test1234567890test1234567890test1234") { return fib(10); };
}
fails.
Luckily, there seems to be a PR, already: #46
In the meantime, there is a workaround:
As a workaround we can add
#define CATCH_CONFIG_CONSOLE_WIDTH 200
(or any width needed) in the benchmark source to overwrite catch2's default output width of 80 characters to prevent long benchmark names wrapping.
https://github.com/benchmark-action/github-action-benchmark/pull/46#issuecomment-1028741207
Or you can try Bencher, the cpp_catch2
adapter can handle multi-line benchmark names.
I'm about to set up continuous benchmarking for our project. We benchmark C++ code in a combined R/C++ project with catch2 in a docker container.
When I try to deploy the benchmark results, I get an error that I struggle to approach:
Error: No benchmark found for bench suite. Possibly mangled output from Catch2:
The benchmark results look fine, however:
Do you have an idea or suggestions?