[PRL] laziness

Jeffrey Palm jpalm at ccs.neu.edu
Wed Jun 23 06:07:18 EDT 2004


David A. Herman wrote:

> 2) Will it "automatically" buy me better performance?
> 
> In my multiple-traversal program, which is going very slowly, if I make
> all the constructors into DELAY-s and the observers into FORCE-s, will my
> program suddenly be faster? In light of (1), I would think its overall
> performance should be the same, although ostensibly the big gain is when
> you delay computations that never end up needing to be performed. In a
> program transformation, though, don't you end up doing all the
> computations anyway? So is it just DELAY-ing the inevitable?

I would think delaying any computation could help your memory 
performance, at least.  Assuming that performing a computation adds to 
the heap, if you can delay this until absolutely necessary you'll avoid 
keeping these results around.  Of course, this depends on what it costs 
--  memory-wise -- to delay your traversals, because that could be more 
expensive.

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



More information about the PRL mailing list