[PRL] laziness

Jeffrey D Palm jpalm at ccs.neu.edu
Wed Jun 23 07:50:23 EDT 2004


Richard C. Cobbe wrote:

> Lo, on Wednesday, June 23, Jeffrey Palm did write:
> 
> 
>>David A. Herman wrote:
>>
>>
>>>2) Will it "automatically" buy me better performance?
>>
>>I would think delaying any computation could help your memory 
>>performance, at least.  Assuming that performing a computation adds to 
> 
> 
> Unfortunately, this is not the case, and it has to do with Johan's fold
> example, quoted below.  I don't quite understand the mechanism by which
> this allocates large amounts of core, and I'm too lazy (pun not
> intended) to work this out now.  However, I think this is similar to a
> problem that came up in a recent SRFI reference implementation of
> laziness, and Joe Marshall (who should be on this list) was one of the
> folks who pointed out the problem with space there.  ISTR he also
> referred me to an implementation that would, in fact, not allocate
> asymptotically more than a strict implementation (don't want to say
> `safe-for-space', because I'm not entirely sure it is).  So I'm sure he
> could explain the problem and a potential solution in some detail.

I made a fairly weak argument that it *could* improve memory 
performance, and this could be the case.  Dave is talking about 
traversing some tree representation of programs, right?  So, if one pass 
does some analysis and holds on the the results until later, this will 
certainly cause a larger footprint than doing on demand.

Jeff

-- 
Jeffrey Palm --> http://www.ccs.neu.edu/home/jpalm



More information about the PRL mailing list