]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/tuple-arrays/tuple-arrays.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / extra / benchmark / tuple-arrays / tuple-arrays.factor
1 ! Copyright (C) 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel math math.functions tuple-arrays accessors fry sequences
4 prettyprint ;
5 IN: benchmark.tuple-arrays
6
7 TUPLE: point { x float } { y float } { z float } ;
8
9 TUPLE-ARRAY: point
10
11 : tuple-array-benchmark ( -- )
12     100 [
13         drop 5000 <point-array> [
14             [ 1 + ] change-x
15             [ 1 - ] change-y
16             [ 1 + 2 / ] change-z
17         ] map [ z>> ] sigma
18     ] sigma . ;
19
20 MAIN: tuple-array-benchmark