]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/make/make.factor
core: Rename iota to <iota> so we can have TUPLE: iota ... ; instead of TUPLE: iota...
[factor.git] / extra / benchmark / make / make.factor
1 ! Copyright (C) 2012 John Benediktsson
2 ! See http://factorcode.org/license.txt for BSD license
3
4 USING: kernel make math sequences ;
5
6 IN: benchmark.make
7
8 : make-strings ( n -- seq )
9     [ [ CHAR: a , ] times ] "" make ;
10
11 : make-arrays ( n -- seq )
12     [ <iota> % ] { } make ;
13
14 : make-vectors ( n -- seq )
15     [ <iota> % ] V{ } make ;
16
17 : make-benchmark ( -- )
18     5,000 <iota> [
19         [ make-strings ] [ make-arrays ] [ make-vectors ] tri
20         3drop
21     ] each ;
22
23 MAIN: make-benchmark