Competing with C in a simple loop

Harendra Kumar harendra.kumar at gmail.com
Fri Dec 23 14:55:42 UTC 2016


On 23 December 2016 at 03:23, Christopher Done <chrisdone at gmail.com> wrote:
>
> But if you scroll down the README to the 182kb file example, you see that
> hexml takes 33us and xeno takes 111us. That's surprising to me because I'm
> doing just a walk across a string and hexml is doing a full parse. It's
> written in C, but still, 3x faster AND doing allocations and more work.
>

hexml being a full parser might fail, on the other hand your program
unconditionally walks the bytestring. Are you sure hexml is actually
completing and not aborting or short-circuiting because of a parse error or
some other error? In all other data points xeno is taking much less time
than hexml except this one. So I am suspecting it could be a problem with
the input, making hexml fail silently. I see that the file used on this
data point has japanese characters, maybe hexml is not able to handle those?

-harendra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20161223/8aad3b67/attachment.html>


More information about the ghc-devs mailing list