Hi Kon, Thanks for running the tests---that was quick! It's true that, as written,
(define (values . rest) (call/cc (lambda (k) (apply k rest)))) would be expensive. You must create a closure, cons up a rest list, and I bet that apply uses some C varargs magic that probably is much slower than a straight function call. But, how hard would it be to specify a re-write rule which takes effect after CPS conversion which transforms (##sys#values k v1 ...) into (k v1 ...) That would solve all these problems in the typical case of explicit values usage (i.e. the first-order case), though values would still be slow if used in a higher-order fashion as the identity function. I can't decipher enough of the re-write rules in c-platform.scm to add such a thing myself, though I suspect that it's about 10 minutes work for somebody who knows what's going on with all these re-write classes. Will On Feb 1, 2008 1:22 PM, Kon Lovett <[EMAIL PROTECTED]> wrote: > ---- VALUES -------------------------------------------------- > 32.571 seconds elapsed > 1.724 seconds in (major) GC > 0 mutations > 3304 minor GCs > 1103 major GCs > ---- LIST ---------------------------------------------------- > 8.244 seconds elapsed > 0.009 seconds in (major) GC > 0 mutations > 2457 minor GCs > 7 major GCs > ---- CC-VALUES -------------------------------------------------- > 42.69 seconds elapsed > 1.735 seconds in (major) GC > 0 mutations > 1824 minor GCs > 1104 major GCs > _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users