mirror of
https://github.com/boostorg/charconv.git
synced 2026-01-31 20:12:20 +00:00
Add benchmark tables
This commit is contained in:
@@ -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[]
|
||||
|
||||
|
||||
44
doc/charconv/benchmarks.adoc
Normal file
44
doc/charconv/benchmarks.adoc
Normal 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
|
||||
|===
|
||||
Reference in New Issue
Block a user