File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11#[
22on OSX:
3- nim r -d:danger tests/benchmarks/tstrfloats_bench.nim
3+ nim r -d:danger -d:numIter:100_000_00 tests/benchmarks/tstrfloats_bench.nim
44("toStringSprintf", "genFloatCast", 11.956240000000001)
55("toStringSprintf", "genFloatConf", 1.581176000000001)
66("toStringDragonbox", "genFloatCast", 0.1652149999999999)
@@ -9,13 +9,14 @@ nim r -d:danger tests/benchmarks/tstrfloats_bench.nim
99
1010import std/ [times, strfloats]
1111
12+ const numIter {.intdefine .} = 10
13+
1214template gen (algo, genFloat) =
1315 proc main {.gensym .} =
14- let n = 100_000_00
1516 var buf: array [strFloatBufLen, char ]
1617 var c = 0
1718 let t = cpuTime ()
18- for i in 0 ..< n :
19+ for i in 0 ..< numIter :
1920 let x = genFloat (i)
2021 let m = algo (buf, x)
2122 when false : # debugging
You can’t perform that action at this time.
0 commit comments