2009-09-27 16:11:21 -04:00
|
|
|
USING: alien.c-types make math sequences splitting grouping
|
2009-09-09 23:33:34 -04:00
|
|
|
kernel columns specialized-arrays bit-arrays ;
|
|
|
|
SPECIALIZED-ARRAY: double
|
2007-09-20 18:09:08 -04:00
|
|
|
IN: benchmark.dispatch2
|
|
|
|
|
2008-06-09 03:14:14 -04:00
|
|
|
: sequences ( -- seq )
|
2007-09-20 18:09:08 -04:00
|
|
|
[
|
2017-06-01 17:59:35 -04:00
|
|
|
1 <iota> ,
|
|
|
|
10 >bignum <iota> ,
|
2007-09-20 18:09:08 -04:00
|
|
|
{ 1 2 3 } ,
|
|
|
|
"hello world" ,
|
|
|
|
SBUF" sbuf world" ,
|
|
|
|
V{ "a" "b" "c" } ,
|
2008-12-03 01:05:54 -05:00
|
|
|
double-array{ 1.0 2.0 3.0 } ,
|
2007-09-20 18:09:08 -04:00
|
|
|
"hello world" 4 tail-slice ,
|
|
|
|
10 f <repetition> ,
|
2017-06-01 17:59:35 -04:00
|
|
|
100 <iota> 2 <groups> ,
|
2007-09-20 18:09:08 -04:00
|
|
|
"hello" <reversed> ,
|
|
|
|
{ { 1 2 } { 3 4 } } 0 <column> ,
|
|
|
|
?{ t f t } ,
|
|
|
|
B{ 1 2 3 } ,
|
|
|
|
[ "a" "b" "c" ] ,
|
|
|
|
1 [ + ] curry ,
|
|
|
|
] { } make ;
|
|
|
|
|
2008-06-09 03:14:14 -04:00
|
|
|
: don't-flush-me ( obj -- ) drop ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2012-07-19 20:35:47 -04:00
|
|
|
: dispatch2-benchmark ( -- )
|
2007-09-20 18:09:08 -04:00
|
|
|
1000000 sequences
|
2012-04-18 20:46:01 -04:00
|
|
|
[ [ first don't-flush-me ] each ] curry times ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2012-07-19 20:35:47 -04:00
|
|
|
MAIN: dispatch2-benchmark
|