From 5024b89b3ae4fc7193c27453f03932d8df221d06 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Fri, 14 May 2021 10:26:34 -0700 Subject: [PATCH] improve tstrfloats_bench --- tests/benchmarks/tstrfloats_bench.nim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/benchmarks/tstrfloats_bench.nim b/tests/benchmarks/tstrfloats_bench.nim index 7d8282d6961a4..4da89eab95b70 100644 --- a/tests/benchmarks/tstrfloats_bench.nim +++ b/tests/benchmarks/tstrfloats_bench.nim @@ -1,6 +1,6 @@ #[ on OSX: -nim r -d:danger tests/benchmarks/tstrfloats_bench.nim +nim r -d:danger -d:numIter:100_000_00 tests/benchmarks/tstrfloats_bench.nim ("toStringSprintf", "genFloatCast", 11.956240000000001) ("toStringSprintf", "genFloatConf", 1.581176000000001) ("toStringDragonbox", "genFloatCast", 0.1652149999999999) @@ -9,13 +9,14 @@ nim r -d:danger tests/benchmarks/tstrfloats_bench.nim import std/[times, strfloats] +const numIter {.intdefine.} = 10 + template gen(algo, genFloat) = proc main {.gensym.} = - let n = 100_000_00 var buf: array[strFloatBufLen, char] var c = 0 let t = cpuTime() - for i in 0..