11# float_serialization_benchmark
22
3- This repository contains benchmarking code for
4-
3+ This repository contains benchmarking code for floating-point serialization.
4+ The goal is to compare different approaches to serializing floating-point
5+ numbers, i.e., converting them from an IEEE 754 binary representation to a
6+ string decimal representation.
7+
8+ Currently, the following approaches are compared:
9+ - [ std::to_string] ( https://en.cppreference.com/w/cpp/string/basic_string/to_string )
10+ - [ fmt::format] ( https://github.com/fmtlib/fmt )
11+ - [ netlib] ( https://github.com/jwiegley/gdtoa )
12+ - [ sprintf] ( https://en.cppreference.com/w/c/io/fprintf )
13+ - [ grisu2] ( https://github.com/simdjson/simdjson/blob/master/src/to_chars.cpp )
14+ - [ std::to_chars] ( https://en.cppreference.com/w/cpp/utility/to_chars )
15+ - [ Dragonbox] ( https://github.com/jk-jeon/dragonbox )
16+ - [ Ryu] ( https://github.com/ulfjack/ryu )
17+ - [ double-conversion] ( https://github.com/google/double-conversion )
18+ - [ Abseil] ( https://github.com/abseil/abseil-cpp )
519
620If you have a recent version of CMake (3.15 or better) under linux, you can simply
721go in the directory and type the following commands:
@@ -12,11 +26,8 @@ cmake --build build
1226./build/benchmarks/benchmark
1327```
1428
15-
16-
1729You may use docker to run these benchmarks easily on a variety of platforms: see https://github.com/lemire/docker_programming_station
1830
19-
2031## Windows
2132
2233Usage under Windows is similar. After installing cmake and Visual Studio 2019, one might type in the appropriate shell:
@@ -37,12 +48,12 @@ Serialize the strings (one per line) included in a text file:
3748
3849Serialize strings generated from floats in (0,1):
3950
40-
4151```
4252./build/benchmarks/benchmark
4353```
4454
45- ## References
55+ ## Other existing benchmarks
4656
4757- [ dtoa Benchmark] ( https://github.com/miloyip/dtoa-benchmark )
48- - [ Benchmark different approaches to parsing scientific datafiles] ( https://github.com/alugowski/parse-bench )
58+ - [ parse-bench] ( https://github.com/alugowski/parse-bench )
59+ - [ Drackennest] ( https://github.com/abolz/Drachennest )
0 commit comments