wc25.3s
this tool300ms
84.3x faster · 1.5 GiB file
fastwc
fastwc — a fast wc rewrite
Table of Contents
Quick Start
- On Arch
paru -S fastwc
# or fastwc-bin for a prebuilt release
- Non-arch
cargo install fastwc
Note: 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
Benchmarks
Benchmark 1: 1.5 GiB file
| Tool | Time | Speed vs fastwc |
|---|---|---|
| fastwc | 0.3s | 1x (baseline) |
| wc | 25.3s | 84.3x slower |
The gains in speed are higher the bigger the file.
Uninstall
cargo uninstall fastwc
Usage
fastwc 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.
Testing Conditions
https://gist.github.com/CallMeAlphabet/4b7022c4b1a8849e6943526de6a23582