Skip to content

Commit

Permalink
Add BENCHMARKING.md for sum.
Browse files Browse the repository at this point in the history
  • Loading branch information
resistor committed Jul 25, 2022
1 parent cd11276 commit 0ec54b2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/uu/sum/BENCHMARKING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Benchmarking `sum`

<!-- spell-checker:ignore wikidatawiki -->

Large sample files can for example be found in the [Wikipedia database dumps](https://dumps.wikimedia.org/wikidatawiki/latest/), usually sized at multiple gigabytes and comprising more than 100M lines.

After you have obtained and uncompressed such a file, you need to build `sum` in release mode

```shell
$ cargo build --release --package uu_sum
```

and then you can time how it long it takes to checksum the file by running

```shell
$ /usr/bin/time ./target/release/sum wikidatawiki-20211001-pages-logging.xml
```

For more systematic measurements that include warm-ups, repetitions and comparisons, [Hyperfine](https://github.com/sharkdp/hyperfine) can be helpful. For example, to compare this implementation to the one provided by your distribution run

```shell
$ hyperfine "./target/release/sum wikidatawiki-20211001-pages-logging.xml" "/usr/bin/sum wikidatawiki-20211001-pages-logging.xml"
```

0 comments on commit 0ec54b2

Please sign in to comment.