Tim Bray recently blogged about topfew,
his Go implementation of a tool to replace the
awk '{print $1}' access_log | sort | uniq -c | sort -rn | head -12
pipeline.
This is a reimplementation of that tool in idiomatic stable Rust.
The initial Rust version was 2.9x faster than Tim's Go implementation; current master appears to be around 6.7x faster thanks to some additional optimizations. The Rust version currently has slightly fewer non-test SLOC than the Go version. Thanks to Thomas Andreas Jung for contributing substantial performance improvements.
``` topfew 0.1.0
USAGE:
tf [OPTIONS]
FLAGS: -h, --help Prints help information -V, --version Prints version information
OPTIONS:
-f, --fields
ARGS:
If you have the Rust toolchain installed, you can install it with cargo install topfew
.