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

Improve performance of VCS diff listing #343

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

yamadapc
Copy link
Contributor

Improves performance of listing yarn lock files and VCS changes by:

  • changing exclude patterns
  • using rayon

Test Plan: cargo test

Created using spr 1.3.5
Copy link

changeset-bot bot commented Feb 17, 2025

⚠️ No Changeset found

Latest commit: 0c27d3d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

yamadapc added a commit that referenced this pull request Feb 17, 2025
Improves performance of listing yarn lock files and VCS changes by:

* changing exclude patterns
* using rayon

Test Plan: cargo test

Pull Request: #343
@yamadapc yamadapc requested review from pancaspe87 and a team February 17, 2025 23:50
@@ -148,11 +149,15 @@ impl VCSState {
exclude_patterns: &[String],
failure_mode: FailureMode,
) -> anyhow::Result<VCSState> {
tracing::info!("Reading VCS state");
Copy link
Contributor

Choose a reason for hiding this comment

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

for my understanding, why do we refer the "full path" rather than doing use tracing::{debug, info, error}; so that we can avoid repeating tracing:: ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't thought too much about it but I generally have used the full path because error, info, etc. are common names that may be shadowed.

let mut command = Command::new("git");
command
.arg("ls-files")
.arg("--cached")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it how we are going to report also staged files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this is just to list the yarn.lock files committed

Copy link
Contributor

Choose a reason for hiding this comment

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

Are we dealing with staged files in a follow up PR?

The command in line 366 will report only unstaged

@yamadapc yamadapc merged commit 27667e3 into main Feb 18, 2025
18 checks passed
@yamadapc yamadapc deleted the spr/yamadapc/improve-performance-of-vcs-diff-listing branch February 18, 2025 00:08
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