mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 21:10:27 +02:00
from the test-suite directory, renamed and adapted for use with benchmarks. * benchmarks/logand.bm, benchmarks/continuations.bm, benchmarks/if.bm: Added as initial fairly stupid examples for benchmarks.
51 lines
1 KiB
Text
51 lines
1 KiB
Text
(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)))
|