Commit | Line | Data |
---|---|---|
1b706edf LC |
1 | ; Dumb benchmark to test the reporting of words marked during gc. |
2 | ; Example: (foo 1000000) | |
3 | ||
4 | (define (ballast bytes) | |
5 | (do ((bytes bytes (- bytes 8)) | |
6 | (x '() (cons bytes x))) | |
7 | ((zero? bytes) x))) | |
8 | ||
9 | (define (words-benchmark bytes0 bytes1) | |
10 | (let ((x (ballast bytes0))) | |
11 | (do ((bytes1 bytes1 (- bytes1 8))) | |
12 | ((not (positive? bytes1)) | |
13 | (car (last-pair x))) | |
14 | (cons (car x) bytes1)))) | |
15 | ||
16 | (define (foo n) | |
17 | (collect) | |
18 | (display-memstats (memstats)) | |
19 | (run-benchmark "foo" (lambda () (words-benchmark 1000000 n)) 1) | |
20 | (display-memstats (memstats))) | |
21 |