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+ - [ grisu-exact] ( https://github.com/jk-jeon/Grisu-Exact )
15+ - [ std::to_chars] ( https://en.cppreference.com/w/cpp/utility/to_chars )
16+ - [ Dragonbox] ( https://github.com/jk-jeon/dragonbox )
17+ - [ Ryu] ( https://github.com/ulfjack/ryu )
18+ - [ double-conversion] ( https://github.com/google/double-conversion )
19+ - [ Abseil] ( https://github.com/abseil/abseil-cpp )
20+ - [ Teju Jagua] ( https://github.com/cassioneri/teju_jagua )
521
622If you have a recent version of CMake (3.15 or better) under linux, you can simply
723go in the directory and type the following commands:
@@ -12,11 +28,8 @@ cmake --build build
1228./build/benchmarks/benchmark
1329```
1430
15-
16-
1731You may use docker to run these benchmarks easily on a variety of platforms: see https://github.com/lemire/docker_programming_station
1832
19-
2033## Windows
2134
2235Usage under Windows is similar. After installing cmake and Visual Studio 2019, one might type in the appropriate shell:
@@ -37,12 +50,12 @@ Serialize the strings (one per line) included in a text file:
3750
3851Serialize strings generated from floats in (0,1):
3952
40-
4153```
4254./build/benchmarks/benchmark
4355```
4456
45- ## References
57+ ## Other existing benchmarks
4658
4759- [ dtoa Benchmark] ( https://github.com/miloyip/dtoa-benchmark )
48- - [ Benchmark different approaches to parsing scientific datafiles] ( https://github.com/alugowski/parse-bench )
60+ - [ parse-bench] ( https://github.com/alugowski/parse-bench )
61+ - [ Drackennest] ( https://github.com/abolz/Drachennest )
0 commit comments