]> git.donarmstrong.com Git - lilypond.git/blobdiff - guile18/benchmark-suite/benchmarks/if.bm
Import guile-1.8 as multiple upstream tarball component
[lilypond.git] / guile18 / benchmark-suite / benchmarks / if.bm
diff --git a/guile18/benchmark-suite/benchmarks/if.bm b/guile18/benchmark-suite/benchmarks/if.bm
new file mode 100644 (file)
index 0000000..30c22c9
--- /dev/null
@@ -0,0 +1,51 @@
+(with-benchmark-prefix "if-<expr>-then-else"
+
+  (benchmark "executing then" 330000
+    (if (quote #t) #t #f))
+
+  (benchmark "executing else" 330000
+    (if (quote #f) #t #f)))
+
+(with-benchmark-prefix "if-<expr>-then"
+
+  (benchmark "executing then" 330000
+    (if (quote #t) #t))
+
+  (benchmark "executing else" 330000
+    (if (quote #f) #t)))
+
+(with-benchmark-prefix "if-<iloc>-then-else"
+
+  (let ((x #t))
+    (benchmark "executing then" 330000
+      (if x #t #f)))
+
+  (let ((x #f))
+    (benchmark "executing else" 330000
+      (if x #t #f))))
+
+(with-benchmark-prefix "if-<iloc>-then"
+
+  (let ((x #t))
+    (benchmark "executing then" 330000
+      (if x #t)))
+
+  (let ((x #f))
+    (benchmark "executing else" 330000
+      (if x #t))))
+
+(with-benchmark-prefix "if-<bool>-then-else"
+
+  (benchmark "executing then" 330000
+    (if #t #t #f))
+
+  (benchmark "executing else" 330000
+    (if #f #t #f)))
+
+(with-benchmark-prefix "if-<bool>-then"
+
+  (benchmark "executing then" 330000
+    (if #t #t))
+
+  (benchmark "executing else" 330000
+    (if #f #t)))