Add benchmark tables

This commit is contained in:
Matt Borland
2023-08-04 15:01:35 -04:00
parent 578cbb82e1
commit 90dbcf1b01
2 changed files with 45 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ include::charconv/chars_format.adoc[]
include::charconv/from_chars.adoc[]
include::charconv/to_chars.adoc[]
include::charconv/reference.adoc[]
include::charconv/benchmarks.adoc[]
include::charconv/sources.adoc[]
include::charconv/copyright.adoc[]

View File

@@ -0,0 +1,44 @@
////
Copyright 2023 Matt Borland
Distributed under the Boost Software License, Version 1.0.
https://www.boost.org/LICENSE_1_0.txt
////
= benchmarks
:idprefix: benchmarks
The benchmarks below were run on x86_64 using GCC 13.1 with libstdc++.
The values are relative to the performance of `std::printf` and `std::stroto(f/d)`.
Larger numbers are more performant (e.g. 2.00 means twice as fast).
.to_chars shortest representation
|===
|Function|Relative Performance (float / double)
|std::printf
|1.00 / 1.00
|Boost.lexical_cast
|0.55 / 0.46
|Boost.spirit.karma
|1.81 / 2.61
|std::to_chars
|3.58 / 4.86
|Boost.Charconv.to_chars
|3.64 / 4.89
|===
.from_chars with scientific formatting
|===
|Function|Relative Performance (float / double)
|std::strto(f/d)
|1.00 / 1.00
|Boost.lexical_cast
|0.00 / 0.00
|Boost.spirit.qi
|2.58 / 3.33
|std::from_chars
|3.18 / 5.80
|Boost.Charconv.from_chars
|3.26 / 5.80
|===