Fix $or
[factor/jcg.git] / extra / benchmark / dispatch5 / dispatch5.factor
blob8b6bd76f3aad95d94055a7b61c36ce5e19050ccb
1 USING: classes classes.tuple kernel sequences vocabs math ;\r
2 IN: benchmark.dispatch5\r
3 \r
4 MIXIN: g\r
5 \r
6 TUPLE: x1 ;\r
7 INSTANCE: x1 g\r
8 TUPLE: x2 ;\r
9 INSTANCE: x2 g\r
10 TUPLE: x3 ;\r
11 INSTANCE: x3 g\r
12 TUPLE: x4 ;\r
13 INSTANCE: x4 g\r
14 TUPLE: x5 ;\r
15 INSTANCE: x5 g\r
16 TUPLE: x6 ;\r
17 INSTANCE: x6 g\r
18 TUPLE: x7 ;\r
19 INSTANCE: x7 g\r
20 TUPLE: x8 ;\r
21 INSTANCE: x8 g\r
22 TUPLE: x9 ;\r
23 INSTANCE: x9 g\r
24 TUPLE: x10 ;\r
25 INSTANCE: x10 g\r
26 TUPLE: x11 ;\r
27 INSTANCE: x11 g\r
28 TUPLE: x12 ;\r
29 INSTANCE: x12 g\r
30 TUPLE: x13 ;\r
31 INSTANCE: x13 g\r
32 TUPLE: x14 ;\r
33 INSTANCE: x14 g\r
34 TUPLE: x15 ;\r
35 INSTANCE: x15 g\r
36 TUPLE: x16 ;\r
37 INSTANCE: x16 g\r
38 TUPLE: x17 ;\r
39 INSTANCE: x17 g\r
40 TUPLE: x18 ;\r
41 INSTANCE: x18 g\r
42 TUPLE: x19 ;\r
43 INSTANCE: x19 g\r
44 TUPLE: x20 ;\r
45 INSTANCE: x20 g\r
46 TUPLE: x21 ;\r
47 INSTANCE: x21 g\r
48 TUPLE: x22 ;\r
49 INSTANCE: x22 g\r
50 TUPLE: x23 ;\r
51 INSTANCE: x23 g\r
52 TUPLE: x24 ;\r
53 INSTANCE: x24 g\r
54 TUPLE: x25 ;\r
55 INSTANCE: x25 g\r
56 TUPLE: x26 ;\r
57 INSTANCE: x26 g\r
58 TUPLE: x27 ;\r
59 INSTANCE: x27 g\r
60 TUPLE: x28 ;\r
61 INSTANCE: x28 g\r
62 TUPLE: x29 ;\r
63 INSTANCE: x29 g\r
64 TUPLE: x30 ;\r
65 INSTANCE: x30 g\r
67 : my-classes ( -- seq )\r
68     "benchmark.dispatch5" words [ tuple-class? ] filter ;\r
70 : a-bunch-of-objects ( -- seq )\r
71     my-classes [ new ] map ;\r
73 : dispatch-benchmark ( -- )\r
74     1000000 a-bunch-of-objects\r
75     [ f [ g? or ] reduce drop ] curry times ;\r
77 MAIN: dispatch-benchmark\r