fastwc — a fast wc rewrite
- On Arch
paru -S fastwc
# or fastwc-bin for a prebuilt release- Non-arch
cargo install fastwcNote: Make sure
~/.cargo/binis in yourPATH. It's added automatically by rustup, but iffastwcisn't found, add this to your shell config file:# If you use Bash: export PATH="$HOME/.cargo/bin:$PATH" # If you use Fish: fish_add_path $HOME/.cargo/bin # If you use Zsh: export PATH="$PATH:$HOME/.cargo/bin"
# Use it!
fastwc /path/to/file| Tool | Time | Speed vs fastwc |
|---|---|---|
| fastwc | 0.16s | 1x (baseline) |
| wc | 23s | 141.6x slower |
The gains in speed are higher the bigger the file.
cargo uninstall fastwcfastwc does not add any additional flags to the original wc. All flags are the same and behave the same. The --help message was changed though.
https://gist.github.com/CallMeAlphabet/4b7022c4b1a8849e6943526de6a23582