]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/splitting/splitting.factor
core: Rename iota to <iota> so we can have TUPLE: iota ... ; instead of TUPLE: iota...
[factor.git] / extra / benchmark / splitting / splitting.factor
1 USING: kernel math sequences splitting ;
2 IN: benchmark.splitting
3
4 : test-data ( -- seq seps )
5     1000 <iota> dup [ 10 /i zero? ] filter ; ! not inline to prevent type inference
6
7 : splitting-benchmark ( -- )
8     test-data 2,000 [
9         over [ even? ] split-when-slice drop
10         2dup split-slice drop
11     ] times 2drop ;
12
13 MAIN: splitting-benchmark