4 ms·
Even supposing they beat the GNU wc, that's not too hard... try beating this one: https://github.com/begriffs/wc https://github.com/begriffs/wc I wrote it in
by begriffs 7y ago
Even supposing they beat the GNU wc, that's not too hard... try beating this one: https://github.com/begriffs/wc https://github.com/begriffs/wc
I wrote it in reply to an earlier post, where someone "beat C" with Haskell.
- eMSF 7y agoGNU wc is actually fairly fast for what it does. That being said, even with all the extra stuff it's doing, I'd assume it to perform roughly as well as your single-threaded version (when you use a non-multibyte locale to keep the comparison even remotely fair).
- aqrit 7y agohere you go: https://github.com/expr-fi/fastlwc https://github.com/expr-fi/fastlwc "Beating wc with C"
- begriffs 7y agoThat's awesome, thanks for sharing. :) There's always someone smarter...
- fao_ 7y agoInteresting! Looks like my twc written in the style of Sean Barrell's Lexing paper was beat :) alx@foo:~/Git$ time ./wc/threads 1 twc/big.txt 128457 1095695 6488666 real 0m0.022s user 0m0.022s sys 0m0.000s alx@foo:~/Git$ time ./twc/twc twc/big.txt 128457 1095695 6488666 twc/big.txt real 0m0.037s user 0m0.025s sys 0m0.012s