benchmark.parse-ratio: adding a ratio parse benchmark.

db4
John Benediktsson 2013-03-28 14:31:45 -07:00
parent 412382abca
commit 47a5619bb4
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
USING: kernel literals math.parser math.vectors random
sequences ;
IN: benchmark.parse-ratio
CONSTANT: test-ratios $[
200,000 100,000 random-integers
200,000 1,000 random-integers 1 v+n v/
]
: parse-ratio-benchmark ( -- )
test-ratios [
[ number>string string>number ] [ assert= ] bi
] each ;
MAIN: parse-ratio-benchmark