Skip to content

Commit 410da77

Browse files
committed
sort: expand numeric sort section in BENCHMARKING.md a bit
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
1 parent fd38fd6 commit 410da77

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/uu/sort/BENCHMARKING.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,19 @@ Run `cargo build --release` before benchmarking after you make a change!
2424

2525
## Sorting numbers
2626

27-
- Generate a list of numbers: `seq 0 100000 | sort -R > shuffled_numbers.txt`.
28-
- Benchmark numeric sorting with hyperfine: `hyperfine "target/release/coreutils sort shuffled_numbers.txt -n -o output.txt"`.
27+
- Generate a list of numbers:
28+
```
29+
shuf -i 1-1000000 -n 1000000 > shuffled_numbers.txt
30+
# or
31+
seq 1 1000000 | sort -R > shuffled_numbers.txt
32+
```
33+
- Benchmark numeric sorting with hyperfine
34+
```
35+
hyperfine --warmup 3 \
36+
'/tmp/gnu-sort -n /tmp/shuffled_numbers.txt'
37+
'/tmp/uu_before sort -n /tmp/shuffled_numbers.txt'
38+
'/tmp/uu_after sort -n /tmp/shuffled_numbers.txt'
39+
```
2940

3041
## Sorting numbers with -g
3142

0 commit comments

Comments
 (0)