]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/regexp/regexp.factor
823c4899b962973339da394e2c66604c804215f4
[factor.git] / extra / benchmark / regexp / regexp.factor
1 ! Copyright (C) 2012 John Benediktsson
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: arrays fry kernel math math.parser regexp sequences
4 strings ;
5 IN: benchmark.regexp
6
7 : regexp-benchmark ( -- )
8     200
9     20,000 <iota> [ number>string ] map
10     200 <iota> [ 1 + CHAR: a <string> ] map
11     '[
12         _ R/ \d+/ [ matches? ] curry all? t assert=
13         _ R/ [a]+/ [ matches? ] curry all? t assert=
14     ] times ;
15
16 MAIN: regexp-benchmark