"...There’s also a parallel version that relies on the monoidal structure of the problem a lot, and that one actually beats C"
coreutils wc is single-threaded, just checked.
11–20 of 74 posts
"...There’s also a parallel version that relies on the monoidal structure of the problem a lot, and that one actually beats C"
coreutils wc is single-threaded, just checked.
This doesn't seem to be comparing anything like the same thing. Does the Haskell version really do the same thing as the C version? Does it handle all of the same error cases, providing the same quality of error messages if they occur? Does it handle localization? If not, that makes the comparison very skewed, as unhammer already pointed out. Sure, if you strip out all of the things that the people who wrote wc actua…
Anyway, destroying Haskell with 100 lines of C :-)
https://raw.githubusercontent.com/gdevic/minix1/master/comma...
Not being great at reading Haskell, I have some questions I was hoping people here could answer: * Does this cope with different whitespace, such as tabs? * Does this cope with different settings of locale? * Does this include the option of the "longest line"? * Does this perform the character counts? I'm pretty sure wc does all these, and that stripping them out would make it faster. If this Haskell version doesn't…
https://github.com/coreutils/coreutils/blob/master/src/wc.c
The word counting algorithm does seem to be much more complex.
He is comparing a multi-threaded haskell version against a single-threaded C version??? "...There’s also a parallel version that relies on the monoidal structure of the problem a lot, and that one actually beats C" coreutils wc is single-threaded, just checked.
He is comparing a multi-threaded haskell version against a single-threaded C version??? "...There’s also a parallel version that relies on the monoidal structure of the problem a lot, and that one actually beats C" coreutils wc is single-threaded, just checked.
But that post left me wondering: is it possible to do better without resorting to parallel processing?
Turns out the answer is yes.
From the introductionLike the other said, the second article will probably be more interesting.