-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Speed up tidy quite a lot #108772
Merged
Merged
Speed up tidy quite a lot #108772
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustbot
added
A-testsuite
Area: The testsuite used to check the correctness of rustc
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
labels
Mar 5, 2023
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 5, 2023
…rsan68 x fmt: Only check modified files locally Previously, `x fmt` would only format modified files, while `x fmt .` and `x fmt --check` would still look at all files. After this change, `x fmt --check` only looks at modified files locally. I feel pretty confident in this change - other than rust-lang#106261, no one has reported bugs in `get_modified_rs_files` since it was added in rust-lang#105702. Combined with the changes in rust-lang#108772, this brings the time for me to run `x t tidy` with a hot FS cache down from 5 to 2 seconds (and moves the majority of the time spent back to `tidy check`, which means it can be sped up more in the future).
rust-cloud-vms
bot
force-pushed
the
faster-tidy
branch
from
March 9, 2023 03:50
219be2d
to
deef3fa
Compare
the8472
reviewed
Mar 10, 2023
jyn514
commented
Mar 10, 2023
the8472
reviewed
Mar 11, 2023
the8472
added
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Mar 14, 2023
This comment has been minimized.
This comment has been minimized.
This makes it easier to profile.
- Skip files in `skip` wherever possible to avoid reading their contents - Don't look for `tidy-alphabetic-start` in tests. It's never currently used and slows the check down a lot. - Add new `filter_not_rust` helper function
Previously, it would walk each directory twice: once in the main `Walk` iterator, and once to count the number of entries in the directory. Now it only walks each directory once.
This has a significant speedup for me locally, from about 1.3 seconds to .9 seconds.
jyn514
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
and removed
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Mar 18, 2023
@bors r+ rollup |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Mar 18, 2023
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 18, 2023
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#107416 (Error code E0794 for late-bound lifetime parameter error.) - rust-lang#108772 (Speed up tidy quite a lot) - rust-lang#109193 (Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed tests) - rust-lang#109234 (Tweak implementation of overflow checking assertions) - rust-lang#109238 (Fix generics mismatch errors for RPITITs on -Zlower-impl-trait-in-trait-to-assoc-ty) - rust-lang#109283 (rustdoc: reduce allocations in `visibility_to_src_with_space`) - rust-lang#109287 (Use `size_of_val` instead of manual calculation) - rust-lang#109288 (Stabilise `unix_socket_abstract`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 23, 2023
…yn514,ozkanonur Don't skip all directories when tidy-checking This fixes a regression from rust-lang#108772 which basically made it that tidy style checks only `README.md` and `COMPILER_TESTS.md`.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 27, 2023
Don't skip all directories when tidy-checking This fixes a regression from rust-lang#108772 which basically made it that tidy style checks only `README.md` and `COMPILER_TESTS.md`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-testsuite
Area: The testsuite used to check the correctness of rustc
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I highly recommend reviewing this commit-by-commit. Based on #106440 for convenience.
Timings
These were collected by running
x test tidy -v
to copy paste the command, then usingsamply record
.before (8 threads)
after (8 threads)
before (64 threads)
after (64 threads)
The last commit makes tidy use more threads, so comparing "before (8 threads)" to "after (64 threads)" is IMO the most realistic comparison. Locally, that brings the time for me to run tidy down from 4 to .9 seconds, i.e. the majority of the time for
x test tidy
is now spend runningfmt --check
.r? @the8472