1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- (define-module (benchmarks if)
- :use-module (benchmark-suite lib))
- (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)))
|