From: Tim Bradshaw
Subject: Re: reducing number consing
Date: 
Message-ID: <ey3vfoj5scy.fsf@lostwithiel.cley.com>
* Cliff Crawford wrote:
> I'm trying to write a simple neural network simulation in Lisp, but
> I'm having trouble with number consing in the inner loop in the
> training function.  According to SBCL's profiler, the function
> feed-forward (see below) conses 32 bytes every time it's called, but
> I'd like it to not cons at all if possible.  Does anyone see what's
> wrong with it?  TIA...

It is probably boxing a float for the return value (SUM).  CMUCL
people will know better how to avoid this, but I think the answer is
block compilation, inlining, and/or aggressive ahead-of-time
declaration of the function type.

--tim