From babfa8b85c0c749e6df879760db9bf73161663ca Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Wed, 5 Feb 2025 19:52:55 -0500 Subject: [PATCH] documenting benchmarks --- .github/pull_request_template.md | 1 + README.md | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 0cbe7b94..9a4f54cd 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,3 +1,4 @@ +We have benchmarks, please consider running them: see our README for details. Our CI tests check formatting automating. If such a test fails, please consider running the bash script: diff --git a/README.md b/README.md index f9abb386..f2181cce 100644 --- a/README.md +++ b/README.md @@ -429,8 +429,7 @@ abseil : 430.45 MB/s (+/- 2.2 %) 20.52 Mfl fastfloat : 1042.38 MB/s (+/- 9.9 %) 49.68 Mfloat/s ``` -See for our benchmarking -code. +See the [Benchmarking](#benchmarking) Section for instructions on how to run our benchmarks. ## Video @@ -486,6 +485,29 @@ You may directly download automatically generated single-header files: +## Benchmarking + +The project has its own benchmarks with realistic data inputs. Under Linux or macOS, +you can use it as follows if your system supports C++17: + +``` +cmake -B build -D FASTFLOAT_BENCHMARKS=ON +cmake --build build +./build/benchmarks/realbenchmark +``` + +Importantly, by default, the benchmark is built in Release mode. + +The instructions are similar under Windows. + +Under Linux and macOS, it is recommended to run the benchmarks in a privileged manner to get access +to hardware performance counters. You may be able to do so with the `sudo` command +in some cases: + +``` +sudo ./build/benchmarks/realbenchmark +``` + ## Packages * The fast_float library is part of the [Conan package