Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add benchmarking for rm #5187

Merged
merged 5 commits into from Aug 25, 2023
Merged

Add benchmarking for rm #5187

merged 5 commits into from Aug 25, 2023

Conversation

Benjscho
Copy link
Contributor

Add benchmarking script and guide for rm, mostly copied from ls benchmarking guide. Tested rm using jwalk instead of walkdir, and saw a slight performance regression, if any change.

Add benchmarking script and guide for `rm`, mostly copied from `ls` benchmarking
guide. Tested `rm` using `jwalk` instead of `walkdir`, and saw a slight performance
regression, if any change.
```shell
#!/bin/bash
cargo build --release --no-default-features --features rm
perf record target/release/coreutils rm "$@"
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might want to try https://github.com/mstange/samply

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's interesting, just tried samply and rm -rf immediately enters into std::sys::unix::fs::remove_dir_impl::remove_dir_all_recursive, which is then 100% of the rest of the samples.

This is likely why rm -rf performance isn't improved by jwalk at all. We might see improvements if we were manually overriding the remove_dir_all_recursive, which appears to be causing other issues with GNU compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was again using the linux kernel with rm -rf

image

Add samply to the sampling options for `rm` benchmarking.
@Benjscho
Copy link
Contributor Author

Only check failing is spelling due to "samply" and "flamegraphs". Is there a way to add words to a spelling ignore dictionary?

@cakebaker
Copy link
Contributor

You can add a HTML comment, see for example https://raw.githubusercontent.com/uutils/coreutils/main/CONTRIBUTING.md

@tertsdiepraam
Copy link
Member

Oh cakebaker was just a bit quicker than me 😄

I think we could also add these words to the list here: https://github.com/uutils/coreutils/blob/main/.vscode/cspell.dictionaries/shell.wordlist.txt#L79 We might need them in other files too.

Add `samply` and `flamegraph` to spell ignore lists.
@Benjscho
Copy link
Contributor Author

Thank you both! Just added those, hopefully will fix the next run

@Benjscho
Copy link
Contributor Author

Looks like the style and lint changes are failing due to files that aren't changed. This could be related to the release of Rust 1.72 which introduced some new clippy warnings. Would it be fine to merge these changes as they're unrelated?

@sylvestre sylvestre merged commit 055537e into uutils:main Aug 25, 2023
40 of 45 checks passed
@sylvestre
Copy link
Sponsor Contributor

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants