]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/flip/flip.factor
3f1b93e645d129b59896733786fb56ba6f874709
[factor.git] / extra / benchmark / flip / flip.factor
1 ! Copyright (C) 2012 John Benediktsson
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel math sequences ;
4 IN: benchmark.flip
5
6 CONSTANT: my-generic { { 1 2 3 } V{ 4 5 6 } "ABC" }
7 CONSTANT: my-array { { 1 2 3 } { 4 5 6 } { 7 8 9 } }
8
9 : flip-benchmark ( -- )
10     1,000,000 [ my-generic flip drop ] times
11     1,000,000 [ my-array flip drop ] times ;
12
13 MAIN: flip-benchmark