On 19/03/2010, at 08:48, Daniel Fischer wrote:

> Am Donnerstag 18 März 2010 21:57:34 schrieb Daniel Fischer:
>> 
>> Contrary to my expectations, however, using unboxed arrays is slower
>> than straight arrays (in my tests).
>> 
> 
> However, a few {-# SPECIALISE #-} pragmas set the record straight.

This is because without specialising, unsafeAt is a straight (inlineable) 
function call for boxed arrays but is overloaded and hence much slower for 
unboxed ones. In general, unboxed arrays tend to be slower in generic code. The 
only real solution is making functions such as binarySearch INLINE.

Roman


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to