2012-07-17 23:35:39 -04:00
|
|
|
! Copyright (C) 2012 John Benediktsson
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
USING: arrays fry kernel math math.parser regexp sequences
|
|
|
|
strings ;
|
2016-06-20 19:43:46 -04:00
|
|
|
IN: benchmark.regexp
|
2012-07-17 23:35:39 -04:00
|
|
|
|
|
|
|
: regexp-benchmark ( -- )
|
|
|
|
200
|
2014-05-18 23:47:22 -04:00
|
|
|
20,000 iota [ number>string ] map
|
2016-06-04 02:52:41 -04:00
|
|
|
200 iota [ 1 + char: a <string> ] map
|
2016-06-25 15:04:03 -04:00
|
|
|
$[
|
2016-06-09 21:54:59 -04:00
|
|
|
_ R[[ \d+]] [ matches? ] curry all? t assert=
|
|
|
|
_ R[[ [a]+]] [ matches? ] curry all? t assert=
|
2012-07-17 23:35:39 -04:00
|
|
|
] times ;
|
|
|
|
|
2016-06-21 15:03:32 -04:00
|
|
|
MAIN: regexp-benchmark
|