Embarrassing correction (Was: reducing number consing)

From: Luke Gorrie (luke_at_bluetail.com)
Date: 12/20/03


Date: 20 Dec 2003 10:39:30 +0100

Luke Gorrie <luke@bluetail.com> writes:

> Finally, though I've been very well brought up not to micro-optimize,
> I couldn't help comparing the foo program to this bar program:
>
> (defvar my-cons (cons nil nil))
> (defun bar (x y) (setf (car my-cons) x) (setf (cdr my-cons) y) my-cons)
> (dotimes (i N) (bar 1 2))
>
> I didn't write down my performance prediction in a sealed envelope,
> but I think I was expecting it to be something like 20-50 times
> faster. I was surprised to find it more like 500 times.

*Ahem*. :-)

I'm pleased to report that I botched this _completely_. You might be
well advised to ignore all that I've said, as my CMUCL source tree
appears to be rather badly broken.

I will refrain from reporting a "correction", lest I botch it up too
somehow. It's easy to measure for yourself.

Cons and be merry!

Cheers,
Luke