Skip to content

xjb714/f2dec_bench

Repository files navigation

a simple demo for bench float/double to decimal and string algorithm.

algorithm Description
schubfach Raffaello Giulietti's algorithm.Origin source code from https://github.com/c4f7fcce9cb06515/Schubfach
schubfach_xjb It is improved by schubfach and has the same output result.
ryu Ulf Adams's Ryū algorithm.
dragonbox Junekey Jeon's CPP implementation.
fmt Victor Zverovich.https://github.com/fmtlib/fmt. version:12.1.0
yy_double yy's algorithm , origin link : https://github.com/ibireme/c_numconv_benchmark/blob/master/vendor/yy_double/yy_double.c
yy_json yy's algorithm. https://github.com/ibireme/yyjson
teju youtube link : https://www.youtube.com/watch?v=fPZ1ZdA7Iwc . An academic paper will be written to provide proof of correctness.https://github.com/cassioneri/teju_jagua
xjb XiangJunBo's algorithm. https://github.com/xjb714/xjb

(1) run :
makefile variable settings:   float/double to decimal : set variable BENCH_F_TO_STR = 0
  float/double to string : set variable BENCH_F_TO_STR = 1
  benchmark double : set variable BENCH_DOUBLE = 1
  benchmark float : set variable BENCH_DOUBLE = 0
compile and exec :
  gcc: make g or make   icpx:make i   clang:make c

(2) benchmark results : CPU : AMD R7 7840H , OS : ubuntu 24.04 compiler : (1)gcc13.3 (2)icpx 2025.0.4 (3)clang 18.1.3

alt text

CPU : Apple M1 , OS : MacOS 26.1 compiler : apple clang 17.0.0 alt text

author : Xiang Jun Bo (xjb) , China , email : [email protected] date : 2025.5.13

About

a simple demo for bench double to shortest decimal algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published