[Haskell-cafe] idea for avoiding temporaries

Ketil Malde Ketil.Malde at bccs.uib.no
Fri Mar 9 02:56:26 EST 2007


David Roundy wrote:
>> Actually, I was thinking this sounded a lot like DiffArrays.
>>     
> Except that DiffArrays are slow and expensive in both space and time
> (compared with strict unboxed arrays).  They necesarily hold boxed values
> so you pay a factor of at least two in space cost (for arrays of Doubles)
> right off the top, and there's no way you could recover that.
What about using a DiffArray with reasonably-sized (cache-friendly?) 
UArrays as the elements?  That way, the cost of boxing can be amortized 
over more Doubles.  Efficiency would depend on updated patterns, of course.

-k


More information about the Haskell-Cafe mailing list