From 4486887239903f56707e54c577313da54a6c47a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20M=2E=20Bezerra?= Date: Wed, 3 Nov 2021 23:10:18 -0300 Subject: [PATCH] Add first benchmark to the readme And fixed a typo --- README.md | 24 +++++++++++++++++++++++- src/commands.rs | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f253c09..def1487 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ - [Usage](#usage) - [Installation](#installation) - [Supported Formats](#supported-formats) +- [Benchmarks](#benchmarks) - [Contributing](#contributing) ## Features @@ -25,7 +26,7 @@ 1. Easy to use. 2. Automatic format detection. 3. Same syntax, various formats. -4. Encoding and decoding streams, it's fast. +4. Encoding and decoding streams, it's fast. 5. No runtime dependencies (for _Linux x86_64_). 6. Listing archive contents with tree formatting (in next release!). @@ -103,6 +104,24 @@ Formats can be chained (`ouch` keeps it _fast_): - `.tar.gz.xz.bz.zst` - `.tar.gz.gz.gz.gz.xz.xz.xz.xz.bz.bz.bz.bz.zst.zst.zst.zst` +## Benchmarks + +Comparison made decompressing `linux.tar.gz` and measured with +[`hyperfine`](https://github.com/sharkdp/hyperfine), times are the average. + +| Tool | `ouch` | [`tar`] | [`bsdtar`] | +|:------------:|:------:|:-------:|:----------:| +| Average time | 911 ms | 1102 ms | 829 ms | + +Note: `ouch` focuses heavily on usage ergonomics and nice error messages, but +we plan on doing some optimization in the future. + +Versions used: + +- `ouch` _0.3.1_ +- [`tar`] _1.34_ +- [`bsdtar`] _3.5.2_ + ## Contributing `ouch` is 100% made out of voluntary work, any small contribution is welcome! @@ -110,3 +129,6 @@ Formats can be chained (`ouch` keeps it _fast_): - Open an issue. - Open a pull request. - Share it to a friend! + +[`tar`]: https://www.gnu.org/software/tar/ +[`bsdtar`]: https://www.freebsd.org/cgi/man.cgi?query=bsdtar&sektion=1&format=html diff --git a/src/commands.rs b/src/commands.rs index 9a8309f..1765211 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -143,7 +143,7 @@ pub fn run(args: Opts, question_policy: QuestionPolicy) -> crate::Result<()> { // Note: If input_extensions is empty then it will make `formats` empty too, which we don't want if !input_extensions.is_empty() && new_formats != formats { // Safety: - // We checked above that input_extensions isn't empty, so files[0] has a extension. + // We checked above that input_extensions isn't empty, so files[0] has an extension. // // Path::extension says: "if there is no file_name, then there is no extension". // Using DeMorgan's law: "if there is extension, then there is file_name".