topfew

Crates.iotopfew
lib.rstopfew
version0.2.3
sourcesrc
created_at2020-05-22 12:51:36.580651
updated_at2021-08-30 12:20:47.941862
descriptionCLI to find high frequency occurrences in structured text files
homepage
repositoryhttps://github.com/djc/topfew-rs
max_upload_size
id244568
size64,057
Dirkjan Ochtman (djc)

documentation

README

topfew-rs: Rust implementation of Tim Bray's topfew tool

Tim Bray 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 main 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] <file> --fields <fields>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -f, --fields <fields>    Fields to use as part of the line's key
    -n, --num <num>          Top number of matches to show [default: 10]
    -e, --regex <regex>      Regular expression used to split lines into fields [default: [ \t]]

ARGS:
    <file>    File to search

If you have the Rust toolchain installed, you can install it with cargo install topfew.

Commit count: 94

cargo fmt