for an improvement in time (surprisingly), use
(define a
(alist->hash-table
(let loop ((i 0)
(r '()))
(if (fx= 250000 i)
r
(loop (fx+ 1 i)
(cons (cons (random 500000) (random 500000)) r))))
=))
instead. personally, id test both on whatever box youre running, as there
are a lot more minor GCs this way. the alist->hash has an interesting property,
though... the first value (if there are duplicate keys) seems to be the one
thats used, the others are ignored. however, its a lot faster to build the
list than to do the hash-table-set!, interestingly.
-elf
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users