Skip to content

Bytes bugfix + major speed improvement for large files

Jeremy Soller requested to merge tdbgamer:master into master

Created by: tdbgamer

Most tail implementations read files backwards rather than keeping a queue and reading the file top to bottom. This is a major speed improvement for large files. Reading an old syslog on my machine went from taking 0.15 seconds to 0.001 seconds.

This also includes a bug fix for the -c flag not working properly. Basically the default for lines with parseargs caused it to never check the -c flag and it would panic if you only passed -c without the lines flag.

To do the optimization I imported a crate I made out of my tail implementation. It includes inotify and getopts as dependencies for the binary, but I can break the lib out into a separate crate if that's an issue for ya'll.

Edited by Ribbon

Merge request reports