Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitbacchus/spectre_benchmarks
https://github.com/bitbacchus/spectre_benchmarks
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/bitbacchus/spectre_benchmarks
- Owner: bitbacchus
- Created: 2021-01-25T16:27:56.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-09T09:24:54.000Z (almost 4 years ago)
- Last Synced: 2024-11-30T22:51:32.108Z (about 1 month ago)
- Language: C++
- Size: 153 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
https://bitbacchus.github.io/spectre_benchmarks/dev/bench/
C++ example for benchmarking with [Catch2 Framework][tool]
====================================================================- [Workflow for this example](../../.github/workflows/catch2.yml)
- [Action log of this example](https://github.com/rhysd/github-action-benchmark/actions?query=workflow%3A%22Catch2+C%2B%2B+Example%22)
- [Benchmark results on GitHub pages](https://rhysd.github.io/github-action-benchmark/dev/bench/)This directory shows how to use [`github-action-benchmark`][action] with [Catch2 Framework][tool].
## Run benchmarks
Official documentation for usage of Catch2 Framework can be found in its repository:
https://github.com/catchorg/Catch2
Since Catch2 is a header-only test framework, you don't need to build it in advance.
Download and put the headers in your `include` directory and write your benchmarks.```cpp
#define CATCH_CONFIG_MAIN
#includeTEST_CASE("Fibonacci") {
// now let's benchmark:
BENCHMARK("Some benchmark") {
// Your benchmark goes here
};
}
```Build the source with C++ compiler and run the built executable to get the benchmark output.
Ensure to use `console` reporter for this. `xml` reporter may be supported in the future.## Process benchmark results
Store the benchmark results with step using the action. Please set `catch2` to `tool` input.
```yaml
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
tool: 'catch2'
output-file-path: benchmark_result.json
```Please read ['How to use' section](https://github.com/rhysd/github-action-benchmark#how-to-use) for common usage.
## Run this example
To try this example, please use [cmake](./CMakeLists.txt) and `clang++`.
```sh
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ cmake --build . --config Release
```This will create `Catch2_bench` executable. The results are output to stdout.
[tool]: https://github.com/catchorg/Catch2
[action]: https://github.com/rhysd/github-action-benchmark