]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/benchmark/dawes/dawes.factor
Specialized array overhaul
[factor.git] / extra / benchmark / dawes / dawes.factor
index 5cd40bc0981d1a8b40525c1af40c91052352cc17..ebfa37cdbcd817a0b18a121a6b5e9e2d3a36857a 100644 (file)
@@ -1,16 +1,15 @@
-USING: sequences hints kernel math specialized-arrays.int fry ;
+USING: sequences kernel math specialized-arrays fry ;
+SPECIALIZED-ARRAY: int
 IN: benchmark.dawes
 
 ! Phil Dawes's performance problem
 
 : count-ones ( int-array -- n ) [ 1 = ] count ; inline
 
-HINTS: count-ones int-array ;
-
 : make-int-array ( -- int-array )
-    120000 [ 255 bitand ] int-array{ } map-as ;
+    120000 [ 255 bitand ] int-array{ } map-as ; inline
 
 : dawes-benchmark ( -- )
-    make-int-array 200 swap '[ _ count-ones ] replicate drop ;
+    200 make-int-array '[ _ count-ones ] replicate drop ;
 
 MAIN: dawes-benchmark