Better HN
topnewbestaskshowjobs
Log inSign up

kiwec

3 karma · joined Nov 25, 2019 (7y ago) · 2 submissions

Submissions

comment 7y ago · link · parent

For some reason, wc is even slower with LANG=C.

    cat words.txt | time wc -w
    13018291
    0.76 user 0.01 system 0:00.78 elapsed
That's on the default wc build of void linux, and not in a proper benchmark environment, but that's still strange.

comment 7y ago · link · parent

After editing my code to use EOF == 0, I get :

    19.55 user 21.49 system 0:41.13 elapsed
However, you're using 8-bit cells, so the resulting word count is incorrect. In case you're wondering, the file was generated with :

    python3 -m faker -o words.txt text -r [large number] -s '\n'