[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MATLAB



At 07:26 PM 12/11/2001 -0600, Tony Kimball wrote:
>Quoth Oliver Steele on Tuesday, 11 December:
>: As someone said earlier, the win for lazy evaluation is when evaluation is
>: infinitely deferred.  It doesn't win when all the values end up being used.
>
>I think you overshoot your mark here.  Instruction schedulers make use
>of a kind of lazy semantics allatime to avoid pipeline stalls,
>misprediction penalties, etc.

There's a difference there. What you're talking about is scheduling across 
multiple resources, as opposed to scheduling across a single resource. 
There's parallelism in the hardware that there isn't in the software, and 
the overhead you need to maximize your throughput is essentially free. 
(Well, it's paid in initial compile time and in circuit complexity) Lazy 
evaluation has a non-zero time cost at runtime, and it's only a win if you 
ultimately save more time than you use to see if you can save some time.

Oliver's right. If you have to pay a constant cost per value to see if 
you're going to use the value, and you use all the values, you're 
guaranteed to lose.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk