This document describes how to build and run benchmarks for Apache Celix.
Benchmarks can be built using the CMake option ENABLE_BENCHMARKING The Apache Celix benchmarks uses Google benchmark library.
To build benchmarks run:
cmake -B build -DENABLE_BENCHMARKING=ON cmake --build build
The following benchmark executables are available after building the utils and framework benchmarks:
Utils Benchmarks:
build/libs/utils/benchmark/celix_filter_benchmarkbuild/libs/utils/benchmark/celix_long_hashmap_benchmarkbuild/libs/utils/benchmark/celix_string_hashmap_benchmarkbuild/libs/utils/benchmark/celix_utils_benchmarkFramework Benchmarks:
build/libs/framework/benchmark/celix_framework_benchmarkPaths may vary depending on your configuration and enabled options.
Benchmark executables are located in the build directory, typically under the relevant bundle or library subdirectory. To run a benchmark:
./build/libs/utils/benchmarks/celix_utils_benchmark ## Command-Line Options The benchmark executables accept standard Google Benchmark command-line options. For example, to run only benchmarks matching a specific pattern and output results in JSON format: ```bash ./build/libs/utils/benchmark/celix_filter_benchmark --benchmark_filter=complexFilter --benchmark_format=json
Replace celix_utils_benchmark and the filter pattern as needed. To see a list of supported command-line flags, run the benchmark executable with the --help option:
./build/libs/utils/benchmarks/./celix_filter_benchmark --help
This will display all available Google Benchmark options.