defconst, defvar: proclaim special at compile-time
[bpt/guile.git] / benchmark-suite / benchmarks / if.bm
1
2 (define-module (benchmarks if)
3 :use-module (benchmark-suite lib))
4
5 (with-benchmark-prefix "if-<expr>-then-else"
6
7 (benchmark "executing then" 330000
8 (if (quote #t) #t #f))
9
10 (benchmark "executing else" 330000
11 (if (quote #f) #t #f)))
12
13 (with-benchmark-prefix "if-<expr>-then"
14
15 (benchmark "executing then" 330000
16 (if (quote #t) #t))
17
18 (benchmark "executing else" 330000
19 (if (quote #f) #t)))
20
21 (with-benchmark-prefix "if-<iloc>-then-else"
22
23 (let ((x #t))
24 (benchmark "executing then" 330000
25 (if x #t #f)))
26
27 (let ((x #f))
28 (benchmark "executing else" 330000
29 (if x #t #f))))
30
31 (with-benchmark-prefix "if-<iloc>-then"
32
33 (let ((x #t))
34 (benchmark "executing then" 330000
35 (if x #t)))
36
37 (let ((x #f))
38 (benchmark "executing else" 330000
39 (if x #t))))
40
41 (with-benchmark-prefix "if-<bool>-then-else"
42
43 (benchmark "executing then" 330000
44 (if #t #t #f))
45
46 (benchmark "executing else" 330000
47 (if #f #t #f)))
48
49 (with-benchmark-prefix "if-<bool>-then"
50
51 (benchmark "executing then" 330000
52 (if #t #t))
53
54 (benchmark "executing else" 330000
55 (if #f #t)))