From: Gabe Garza
Subject: [Summary] I/O optimization in CMUCL
Date: 
Message-ID: <xptH6.34514$Jh5.30211470@news1.rdc1.sfba.home.com>
Wow, thanks a lot to everyone for all the advice!

The following (non-stylistic)^1 suggestions were offered:

1.) rewrite using a single loop with ROW-MAJOR-AREF
2.) use FORMATTER instead of format
3.) make an array of all 255 possible strings and index it with the int
    to avoid having to call format in the inner loop
4.) use the binary format of ppm and use write-byte

   Apologies if I missed any.  I tried the first two and the improvements
were marginal. (Less then %5).  

   Profiling showed that it was cons'ing even more then the
ray tracing was--and it was taking upwards of 20 seconds even for small images
(100x100).

   I did not try the third, but from profiling the first two and the last
I think it would be the way to go if the binary format couldn't be used.
FORMAT is hideously expensive (at least in CMUCL). 

   I tried the last option, and low and behold the consing dropped to zero
and the run time to less then a second.  I stopped here because at this
point the time to write the file is significantly less then the time to ray
trace it, even for small images.  I'm on to far more visually intriguing
inefficiencies now. ;)

Gabe Garza

(1) Though not listed, the stylistic suggestions were appreciated!  This is
the first time I've done something non-trivial with lisp; my background is 
all C and its offspring.