]> gitweb.factorcode.org Git - factor.git/commitdiff
benchmark.splitting: stop using split* and use slices only.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 1 Apr 2013 17:26:43 +0000 (10:26 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 1 Apr 2013 17:26:43 +0000 (10:26 -0700)
extra/benchmark/splitting/splitting.factor

index 6a9104fcd6d64f37f5b4e0149ff212366a16ad08..55351b20821b92df7f1695ca88e650a0eddd0815 100644 (file)
@@ -1,15 +1,13 @@
 USING: kernel math sequences splitting ;
 IN: benchmark.splitting
 
-: test-data ( -- seq seps ) 
+: test-data ( -- seq seps )
     1000 iota dup [ 10 /i zero? ] filter ; ! not inline to prevent type inference
 
 : splitting-benchmark ( -- )
-    test-data 1,000 [
-        over [ even? ] split-when drop
+    test-data 2,000 [
         over [ even? ] split-when-slice drop
-        2dup split drop
-        2dup split* drop
+        2dup split-slice drop
     ] times 2drop ;
 
 MAIN: splitting-benchmark