]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/dispatch2/dispatch2.factor
Updating code for make and fry changes
[factor.git] / extra / benchmark / dispatch2 / dispatch2.factor
1 USING: make math sequences splitting grouping
2 kernel columns float-arrays bit-arrays ;
3 IN: benchmark.dispatch2
4
5 : sequences ( -- seq )
6     [
7         1 ,
8         10 >bignum ,
9         { 1 2 3 } ,
10         "hello world" ,
11         SBUF" sbuf world" ,
12         V{ "a" "b" "c" } ,
13         F{ 1.0 2.0 3.0 } ,
14         "hello world" 4 tail-slice ,
15         10 f <repetition> ,
16         100 2 <sliced-groups> ,
17         "hello" <reversed> ,
18         { { 1 2 } { 3 4 } } 0 <column> ,
19         ?{ t f t } ,
20         B{ 1 2 3 } ,
21         [ "a" "b" "c" ] ,
22         1 [ + ] curry ,
23     ] { } make ;
24
25 : don't-flush-me ( obj -- ) drop ;
26
27 : dispatch-test ( -- )
28     1000000 sequences
29     [ [ 0 swap nth don't-flush-me ] each ] curry times ;
30
31 MAIN: dispatch-test