Using my gcstats library, I get the following info. GC is about 75%
of the total runtime, which surprises me since there should be no
garbage until all the channels are set up, which takes most of the
time. Note the extremely large amount of slop space.
305,562,856 bytes allocated in the heap
304,922,088 bytes collected by GC
1,755,839,256 bytes max heap size
975,524,384 bytes max slop
2,722,820,096 bytes peak total memory use
Generation 0: 64 collections, 25,581ms, 25,635.9ms elapsed
Generation 1: 6 collections, 4,980ms, 4,982.54ms elapsed
INIT time 12 ms
MUT time 9,461 ms ( 9,456.13 ms elapsed)
GC time 30,561 ms ( 30,618.52 ms elapsed)
TOTAL time 40,034 ms ( 40,086.65 ms elapsed)
%GC time 76.36% ( 76.40% elapsed)
Alloc rate 32,297,099 bytes per MUT second
for this slightly modified version:
#lang racket/base
(define leftmost (make-channel))
(define (setup-whispers left i n)
(if (>= i n)
left
(let ((right (make-channel)))
(thread (lambda ()
(channel-put left (+ 1 (channel-get right)))))
(setup-whispers right (+ 1 i) n))))
(define rightmost (setup-whispers leftmost 0 100000))
(thread (lambda () (channel-put rightmost 1)))
(channel-get leftmost)
--
sam th
sa...@ccs.neu.edu