]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/nested-empty-loop-2/nested-empty-loop-2.factor
d99ca05a735731c80498470b0532c4d3bfb70686
[factor.git] / extra / benchmark / nested-empty-loop-2 / nested-empty-loop-2.factor
1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel math math.ranges sequences locals hints ;
4 IN: benchmark.nested-empty-loop-2
5
6 : times ( seq quot -- ) [ drop ] prepose each ; inline
7
8 :: nested-empty-loop ( n -- )
9     n [1..b] [
10         n [1..b] [
11             n [1..b] [
12                 n [1..b] [
13                     n [1..b] [
14                         n [1..b] [
15                             n [1..b] [
16                                 n [1..b] [
17                                     n [1..b] [ ] times
18                                 ] times
19                             ] times
20                         ] times
21                     ] times
22                 ] times
23             ] times
24         ] times
25     ] times ;
26
27 HINTS: nested-empty-loop fixnum ;
28
29 : nested-empty-loop-2-benchmark ( -- ) 7 nested-empty-loop ;
30
31 MAIN: nested-empty-loop-2-benchmark