[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Is Haskell capable of matching C in string processin

Subject: Re: [Haskell-cafe] Is Haskell capable of matching C in string processing performance?
From: John Millikin
Date: Fri, 22 Jan 2010 09:40:58 -0800
Correct me if I'm wrong, but ByteStrings can't contain non-ASCII
values, right? I'm looking for something like this pseudo-C:

    typedef void (*Callback)(const uint32_t *chars, size_t n_chars, void *);
    WriterState *new_state (Callback, void *);

I tried using the Text type, but its conversions to Ptr Word16 are all
O(n) -- not much better than String.

On Thu, Jan 21, 2010 at 22:28, Don Stewart <[email protected]> wrote:
> jmillikin:
>> Here's the fastest Haskell version I could come up with. It discards
>> all error handling, validation, and correctness in the name of
>> performance, but still can't get anywhere near C:
>> http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16423
> Thanks for posting the code.
> You're not using bytestrings??
> They were invented to deal with the problem of [Char] being a poor
> structure for large scale string processing, and you should have no
> problem getting C-like string performance.
> Â Âhttp://www.cse.unsw.edu.au/~dons/papers/CSL06.html
> -- Don
Haskell-Cafe mailing list
[email protected]

<Prev in Thread] Current Thread [Next in Thread>