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

Skip running clippy without default features #10098

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

jcgruenhage
Copy link
Member

@jcgruenhage jcgruenhage commented Dec 11, 2024

Problem

Running clippy with cargo hack --feature-powerset in CI isn't particularly fast. This PR follows-up on #8912 to improve the speed of our clippy runs.

Parallelism as suggested in #9901 was tested, but didn't show consistent enough improvements to be worth it. It actually increased the amount of work done, as there's less cache hits when clippy runs are spread out over multiple target directories. Additionally, parallelism makes it so caching needs to be thought about more actively and copying around target directories to enable parallelism eats the rest of the performance gains from parallel execution.

After some discussion, the decision was to instead cut down on the number of jobs that are running further. The easiest way to do this is to not run clippy without default features. The list of default features is empty for all crates, and I haven't found anything using cfg(feature = "default") either, so this is likely not going to change anything except speeding the runs up.

Summary of changes

Reduce the amount of feature combinations tried by cargo hack (as suggested in #8912 (review)) by never disabling default features.

Alternatives

  • We can split things out into different jobs which reduces the time until everything is finished by running more things in parallel. This does however decreases the amount of cache hits and increases the amount of time spent on overhead tasks like repo cloning and restoring caches by doing those multiple times instead of once.
  • We could replace cargo hack [...] clippy with cargo clippy [...]; cargo clippy --features testing. I'm not 100% sure how this compares to the change here in the PR, but it does seem to run a bit faster. That likely means it's doing less work, but without understanding what exactly we loose by that I'd rather not do that for now. I'd appreciate input on this though.

@jcgruenhage jcgruenhage force-pushed the jcgruenhage/bench-cargo-hack branch 5 times, most recently from a6eb6ad to 68c9fc0 Compare December 11, 2024 23:21
Copy link

github-actions bot commented Dec 12, 2024

7095 tests run: 6798 passed, 0 failed, 297 skipped (full report)


Flaky tests (4)

Postgres 16

  • test_pgdata_import_smoke[None-1024-RelBlockSize.MULTIPLE_RELATION_SEGMENTS]: release-arm64
  • test_pageserver_chaos[None]: release-arm64
  • test_physical_replication_config_mismatch_too_many_known_xids: release-arm64

Postgres 14

Code coverage* (full report)

  • functions: 31.2% (8395 of 26865 functions)
  • lines: 48.0% (66648 of 138939 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
6a2af57 at 2024-12-19T11:50:22.625Z :recycle:

@jcgruenhage jcgruenhage force-pushed the jcgruenhage/bench-cargo-hack branch 5 times, most recently from 5a9b6c7 to 2dc129f Compare December 19, 2024 10:08
@jcgruenhage jcgruenhage force-pushed the jcgruenhage/bench-cargo-hack branch from 2dc129f to 6a2af57 Compare December 19, 2024 10:35
@jcgruenhage jcgruenhage changed the title tmp, don't merge: benchmark different cargo-hack partition counts for runner sizes Skip running clippy without default features Dec 19, 2024
@jcgruenhage jcgruenhage marked this pull request as ready for review December 19, 2024 11:19
@jcgruenhage jcgruenhage requested a review from a team as a code owner December 19, 2024 11:19
@jcgruenhage jcgruenhage added this pull request to the merge queue Jan 2, 2025
Merged via the queue into main with commit 26600f2 Jan 2, 2025
86 checks passed
@jcgruenhage jcgruenhage deleted the jcgruenhage/bench-cargo-hack branch January 2, 2025 11:34
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.

2 participants