diff --git a/extra/benchmark/ant/ant.factor b/extra/benchmark/ant/ant.factor index d40cde3d23..3f32881562 100644 --- a/extra/benchmark/ant/ant.factor +++ b/extra/benchmark/ant/ant.factor @@ -23,19 +23,18 @@ IN: benchmark.ant : sum-digits ( n -- x ) 0 swap [ dup zero? ] [ 10 /mod swap [ + ] dip ] until drop ; -! FIXME: Find out why this makes it 430 times slower -! TUPLE: point x y ; -! C: point +TUPLE: point x y ; +C: point -USE: alien.c-types -USE: classes.struct -STRUCT: point { x uint } { y uint } ; -: ( x y -- point ) point ; inline +! USE: alien.c-types +! USE: classes.struct +! STRUCT: point { x uint } { y uint } ; +! : ( x y -- point ) point ; inline : walkable? ( point -- ? ) [ x>> ] [ y>> ] bi [ sum-digits ] bi@ + 25 <= ; inline -:: ant ( -- ) +:: ant-benchmark ( -- ) 200000 hash-set boa :> seen 100000 :> stack 0 :> total! @@ -56,4 +55,4 @@ STRUCT: point { x uint } { y uint } ; ] unless ] until total 148848 assert= ; -MAIN: ant +MAIN: ant-benchmark