Hello Bryan,

Sunday, May 27, 2007, 3:30:50 AM, you wrote:
>> I think, given my simple algorithm that means that (==) for
>> ByteStrings is slower than (==) for String.  Is this possible?

> Yes indeed.  Over ByteStrings, (==) is implemented as a call to memcmp.
>   For small strings, this loses by a large margin because it has to go
> through the FFI.

how about using *unsafe* memcmp import and more complex code for the
case of large BS length?

a==b | min (length a) (length b) < 20   = memcmp a b
     ....


-- 
Best regards,
 Bulat                            mailto:[EMAIL PROTECTED]

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

Reply via email to