3 ;; A library of dumb functions that may be used to benchmark Guile-VM.
7 (if (or (= x 1) (= x 2))
20 ;; This one shows that procedure calls are no faster than within the
21 ;; interpreter: the VM yields no performance improvement.
26 ;; Disassembly of `loop'
28 ; Disassembly of #<objcode 302360b0>:
32 ; 0 (make-int8 64) ;; 64
37 ; 17 (make-int8:0) ;; 0
38 ; 18 (load-symbol "n") ;; n
39 ; 28 (make-false) ;; #f
40 ; 29 (make-int8:0) ;; 0
44 ; 36 (make-int8 8) ;; 8
45 ; 38 (make-int8 2) ;; 2
46 ; 40 (make-int8 6) ;; 6
49 ; 44 (make-int8 23) ;; 23
50 ; 46 (make-int8 4) ;; 4
51 ; 48 (make-int8 12) ;; 12
54 ; 52 (make-int8 25) ;; 25
55 ; 54 (make-int8 4) ;; 4
56 ; 56 (make-int8 6) ;; 6
59 ; 44 (make-int8 23) ;; 23
60 ; 46 (make-int8 4) ;; 4
61 ; 48 (make-int8 12) ;; 12
64 ; 52 (make-int8 25) ;; 25
65 ; 54 (make-int8 4) ;; 4
66 ; 56 (make-int8 6) ;; 6
70 ; 62 load-program ##{201}#
80 ; 3 (make-int8:0) ;; 0
83 ; 8 (br-if-not 0 2) ;; -> 13
84 ; 11 (make-int8:0) ;; 0
103 ;; Same as `loop' using `do'.
111 ;; This one shows that the built-in `cons' instruction yields a significant
112 ;; improvement (speedup: 1.5).
117 (loop (1- x) (cons x result)))))
119 (define big-list (iota 500000))
121 (define (copy-list lst)
128 (cons (car lst) result)))))