3 ms·
Could also be that their version of wc is doing Unicode-aware counting by default; it could be a lot faster with LANG=C set in the environment. https://unix.st
by re 7y ago
Could also be that their version of wc is doing Unicode-aware counting by default; it could be a lot faster with LANG=C set in the environment.
https://unix.stackexchange.com/a/96580 https://unix.stackexchange.com/a/96580
- kiwec 7y agoFor 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.
- labawi 7y agoI prefer setting LC_ALL=C for to be sure, though LANG may be sufficient, as running "LANG=C locale" confirms LC_CTYPE=C is set.