Skip to content

Commit 3a74bfb

Browse files
authored
Merge pull request #299 from fastfloat/document_bench
documenting benchmarks
2 parents 482cc1f + babfa8b commit 3a74bfb

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
We have benchmarks, please consider running them: see our README for details.
12

23
Our CI tests check formatting automating. If such a test fails, please consider running the bash script:
34

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,7 @@ abseil : 430.45 MB/s (+/- 2.2 %) 20.52 Mfl
428428
fastfloat : 1042.38 MB/s (+/- 9.9 %) 49.68 Mfloat/s
429429
```
430430

431-
See <https://github.com/lemire/simple_fastfloat_benchmark> for our benchmarking
432-
code.
431+
See the [Benchmarking](#benchmarking) Section for instructions on how to run our benchmarks.
433432

434433
## Video
435434

@@ -485,6 +484,29 @@ You may directly download automatically generated single-header files:
485484

486485
<https://github.com/fastfloat/fast_float/releases/download/v7.0.0/fast_float.h>
487486

487+
## Benchmarking
488+
489+
The project has its own benchmarks with realistic data inputs. Under Linux or macOS,
490+
you can use it as follows if your system supports C++17:
491+
492+
```
493+
cmake -B build -D FASTFLOAT_BENCHMARKS=ON
494+
cmake --build build
495+
./build/benchmarks/realbenchmark
496+
```
497+
498+
Importantly, by default, the benchmark is built in Release mode.
499+
500+
The instructions are similar under Windows.
501+
502+
Under Linux and macOS, it is recommended to run the benchmarks in a privileged manner to get access
503+
to hardware performance counters. You may be able to do so with the `sudo` command
504+
in some cases:
505+
506+
```
507+
sudo ./build/benchmarks/realbenchmark
508+
```
509+
488510
## Packages
489511

490512
* The fast_float library is part of the [Conan package

0 commit comments

Comments
 (0)