Debian Codegraph @

test/apply-performance.scm

raw
1 ;;
2 ;; This code measures the effect of TAILP-APPLY
3 ;;
4
5 (use gauche.time)
6
7 (define Apply #f) ; prevent apply inlining
8
9 (define (foo a b c d e f g h i j . args)
10 (+ a b c d e f g h i j))
11
12 (define (main args)
13 (set! Apply apply)
14 (time (dotimes [10000000]
15 (Apply foo 1 2 3 4 5 6 7 8 9 10 '(a b c))))
16 0)