shuf: document new benchmark category

This commit is contained in:
Ben Wiederhake 2024-02-17 01:14:40 +01:00
parent 352a8a5bd7
commit f25b2102db

View file

@ -28,11 +28,11 @@ a range of numbers to randomly sample from. An example of a command that works
well for testing: well for testing:
```shell ```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 To measure the time taken by shuffling an input file, the following command can
be used:: be used:
```shell ```shell
hyperfine --warmup 10 "target/release/shuf input.txt > /dev/null" hyperfine --warmup 10 "target/release/shuf input.txt > /dev/null"
@ -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 the command will run forever. An example of a hyperfine command is
```shell ```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"
``` ```