factor/extra/benchmark/regexp/regexp.factor

17 lines
451 B
Factor
Raw Normal View History

! Copyright (C) 2012 John Benediktsson
! See http://factorcode.org/license.txt for BSD license.
USING: arrays fry kernel math math.parser regexp sequences
strings ;
IN: benchmark.regexp
: regexp-benchmark ( -- )
200
2014-05-18 23:47:22 -04:00
20,000 iota [ number>string ] map
200 iota [ 1 + CHAR: a <string> ] map
'[
_ R/ \d+/ [ matches? ] curry all? t assert=
_ R/ [a]+/ [ matches? ] curry all? t assert=
] times ;
MAIN: regexp-benchmark