]> gitweb.factorcode.org Git - factor.git/commitdiff
benchmark.tuple-arrays: cleanup, assert result.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 2 Jun 2014 15:40:05 +0000 (08:40 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 2 Jun 2014 15:40:05 +0000 (08:40 -0700)
extra/benchmark/tuple-arrays/tuple-arrays.factor

index c801e8d993659c9d7c14143e880e7abb6179a2b5..0f5313b41e2ce2e8606fd83ac139a0a3f29da821 100644 (file)
@@ -1,7 +1,6 @@
 ! Copyright (C) 2009, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel math math.functions tuple-arrays accessors fry sequences
-prettyprint ;
+USING: accessors kernel math sequences tuple-arrays ;
 IN: benchmark.tuple-arrays
 
 TUPLE: point { x float } { y float } { z float } ; final
@@ -9,12 +8,12 @@ TUPLE: point { x float } { y float } { z float } ; final
 TUPLE-ARRAY: point
 
 : tuple-arrays-benchmark ( -- )
-    100 iota [
-        drop 5000 <point-array> [
+    1,000 iota [
+        drop 5,000 <point-array> [
             [ 1 + ] change-x
             [ 1 - ] change-y
             [ 1 + 2 / ] change-z
         ] map [ z>> ] map-sum
-    ] map-sum . ;
+    ] map-sum 0x1.312dp21 assert= ;
 
 MAIN: tuple-arrays-benchmark