]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/regexp/regexp.factor
factor: trim using lists
[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: kernel math math.parser regexp sequences strings ;
4 IN: benchmark.regexp
5
6 : regexp-benchmark ( -- )
7     200
8     20,000 <iota> [ number>string ] map
9     200 <iota> [ 1 + CHAR: a <string> ] map
10     '[
11         _ R/ \d+/ [ matches? ] curry all? t assert=
12         _ R/ [a]+/ [ matches? ] curry all? t assert=
13     ] times ;
14
15 MAIN: regexp-benchmark