1 USING: sequences hints kernel math specialized-arrays.int fry ;
4 ! Phil Dawes's performance problem
6 : count-ones ( int-array -- n ) [ 1 = ] count ; inline
8 HINTS: count-ones int-array ;
10 : make-int-array ( -- int-array )
11 120000 [ 255 bitand ] int-array{ } map-as ;
13 : dawes-benchmark ( -- )
14 make-int-array 200 swap '[ _ count-ones ] replicate drop ;