Skip to content

Commit

Permalink
shuf: document new benchmark category
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWiederhake authored and sylvestre committed Feb 19, 2024
1 parent bf93582 commit 7707771
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/uu/shuf/BENCHMARKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ a range of numbers to randomly sample from. An example of a command that works
well for testing:

```shell
hyperfine --warmup 10 "target/release/shuf -i 0-10000000"
hyperfine --warmup 10 "target/release/shuf -i 0-10000000 > /dev/null"
```

To measure the time taken by shuffling an input file, the following command can
be used::
be used:

```shell
hyperfine --warmup 10 "target/release/shuf input.txt > /dev/null"
Expand All @@ -49,5 +49,14 @@ should be benchmarked separately. In this case, we have to pass the `-n` flag or
the command will run forever. An example of a hyperfine command is

```shell
hyperfine --warmup 10 "target/release/shuf -r -n 10000000 -i 0-1000"
hyperfine --warmup 10 "target/release/shuf -r -n 10000000 -i 0-1000 > /dev/null"
```

## With huge interval ranges

When `shuf` runs with huge interval ranges, special care must be taken, so it
should be benchmarked separately also. An example of a hyperfine command is

```shell
hyperfine --warmup 10 "target/release/shuf -n 100 -i 1000-2000000000 > /dev/null"
```

0 comments on commit 7707771

Please sign in to comment.