https://github.com/codspeedhq/boost-benches
Boost benchmarks in C++
https://github.com/codspeedhq/boost-benches
benchmark boost cpp
Last synced: 7 months ago
JSON representation
Boost benchmarks in C++
- Host: GitHub
- URL: https://github.com/codspeedhq/boost-benches
- Owner: CodSpeedHQ
- License: mit
- Created: 2025-03-13T17:34:54.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-03-26T17:02:25.000Z (10 months ago)
- Last Synced: 2025-03-26T17:43:09.032Z (10 months ago)
- Topics: benchmark, boost, cpp
- Language: C++
- Homepage: https://codspeed.io/CodSpeedHQ/boost-benches
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Boost Benchmarks
A benchmarking suite for comparing performance of various Boost C++ library components using Google Benchmark.
## Requirements
- CMake 3.14+
- C++17 compiler
- Boost 1.87.0+ (with serialization and graph components)
## Building
```bash
# Create build directory
mkdir -p build
cd build
# Configure and build
# For regular timing-based benchmarks:
cmake -DCODSPEED_MODE=walltime ..
# For CodSpeed instrumentation:
cmake -DCODSPEED_MODE=instrumentation ..
make
```
## Running benchmarks
From the build directory:
```bash
# Run individual component benchmarks
./string_bench
./container_bench
./utility_bench
./optional_bench
./spirit_bench
./multiindex_bench
./graph_bench
./serialization_bench
# Run all benchmarks with a single command
cmake --build . --target run_all_benchmarks
# Pass arguments to all benchmarks
cmake --build . --target run_all_benchmarks -- --benchmark_filter=BM_Boost
# Run with regex filter
./string_bench --benchmark_filter="BM_BoostLexicalCast"
# List available benchmarks
./string_bench --benchmark_list_tests
```
## Benchmark Categories
- **string_bench**: String operations, lexical_cast, regex, format
- **container_bench**: Container performance comparisons
- **utility_bench**: Type-safe any, algorithms, UUID generation
- **optional_bench**: Boost vs std::optional
- **spirit_bench**: Parsing operations (CSV, JSON, expressions)
- **multiindex_bench**: Multi-index container operations
- **graph_bench**: Graph algorithms (Dijkstra, A*, BFS, DFS)
- **serialization_bench**: Serialization performance (text, binary, XML)
## Custom Boost Version
Specify a custom Boost version:
```bash
cmake -DBOOST_VERSION=1.82.0 -DCODSPEED_MODE=walltime ..
```
## CodSpeed Integration
This project integrates with [CodSpeed](https://codspeed.io/) for CI performance tracking. For local testing, use:
```bash
cmake -DCODSPEED_MODE=instrumentation ..
make
./string_bench # Will show notice about running outside CI
```
For CI integration, ensure the `CODSPEED_TOKEN` secret is set in your GitHub repository.