mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-31 21:17:46 +00:00
ls: document hyperfine script
This commit is contained in:
parent
4023e40174
commit
35838dc8a9
1 changed files with 9 additions and 2 deletions
|
@ -26,7 +26,15 @@ Example: `hyperfine --warmup 2 "target/release/coreutils ls -al -R tree > /dev/n
|
|||
`hyperfine --warmup 2 "target/release/coreutils ls -al -R tree > /dev/null" "ls -al -R tree > /dev/null"`
|
||||
(This assumes GNU ls is installed as `ls`)
|
||||
|
||||
This can also be used to compare with version of ls built before your changes to ensure your change does not regress this
|
||||
This can also be used to compare with version of ls built before your changes to ensure your change does not regress this.
|
||||
|
||||
Here is a `bash` script for doing this comparison:
|
||||
```bash
|
||||
#!/bin/bash
|
||||
cargo build --no-default-features --features ls --release
|
||||
args="$@"
|
||||
hyperfine "ls $args" "target/release/coreutils ls $args"
|
||||
```
|
||||
|
||||
## Checking system call count
|
||||
|
||||
|
@ -43,7 +51,6 @@ cargo flamegraph --cmd coreutils -- ls [additional parameters]
|
|||
However, if the `-R` option is given, the output becomes pretty much useless due to recursion. We can fix this by merging all the direct recursive calls with `uniq`, below is a `bash` script that does this.
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
cargo build --release --no-default-features --features ls
|
||||
perf record target/release/coreutils ls "$@"
|
||||
perf script | uniq | inferno-collapse-perf | inferno-flamegraph > flamegraph.svg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue