benchmark.parse-float: add a float parse benchmark.

db4
John Benediktsson 2013-03-28 11:41:57 -07:00
parent 02d9565732
commit ff39d3f53a
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
USING: kernel literals math.functions math.parser random
sequences ;
IN: benchmark.parse-float
CONSTANT: test-floats $[ 100,000 random-units ]
: parse-float-benchmark ( -- )
test-floats [
[ number>string string>number ] [ 1e-10 ~ t assert= ] bi
] each ;
MAIN: parse-float-benchmark