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

feat(package): implement vcs status cache #14985

Closed
wants to merge 2 commits into from

Conversation

weihanglo
Copy link
Member

@weihanglo weihanglo commented Dec 26, 2024

What does this PR try to resolve?

Implement a VCS status cache for cargo package.

It may not be worthy for the majority. Single file git status is generally fast.
Also, it might only benefit whoever does cargo package for the entire workspace in one cargo invocation, such as cargo package --workspace or using -Zpackage-workspace.

On some slow file systems or lower-end machines,
skipping file system access might be helpful.

However, slow file system access usually happens on Window.
And we'll only have large amount of git status when
#14981 merges and the repo contains lots of symlinks.
Given symlink handling story is crazy in real world Windows

How should we test and review this PR?

I didn't really benchmark it.
If any reviewer doesn't think it is worth the complexity,
feel free to close hits.

Additional information

@rustbot
Copy link
Collaborator

rustbot commented Dec 26, 2024

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-git Area: anything dealing with git Command-package S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 26, 2024
@rustbot

This comment has been minimized.

This is aimed to cache duplicate works like file system or VCS info lookups.
It may not be worthy for the majority.
Single file `git status` is generally fast.

On some slow file systems or lower-end machines,
skipping file system access might be helpful.

However, slow file system access usually happen on Window.
And we'll only have large amount of `git status` when
rust-lang#14981 merges and the repo contains lots of symlinks.
Given symlink handling story is crazy in real world Windows,
I doubt anybody will hit the performance issue without this.
@epage
Copy link
Contributor

epage commented Dec 31, 2024

So this only really helps us with source files outside of the package root? Is this going to buy us enough gains to be worth the performance hit?

@weihanglo
Copy link
Member Author

weihanglo commented Dec 31, 2024

So this only really helps us with source files outside of the package root? Is this going to buy us enough gains to be worth the performance hit?

Yes. This is kind of another speculation. It only helps in that situation and when having lots of workspace members sharing the same set of files-outside-package-root.

I lean toward closing this and then revive #14962, once #14981 has merged. The workspace inheritance issue won't be harder to fix with or without #14962

@rustbot
Copy link
Collaborator

rustbot commented Dec 31, 2024

☔ The latest upstream changes (possibly d85d761) made this pull request unmergeable. Please resolve the merge conflicts.

@weihanglo
Copy link
Member Author

Close as it is just a speculation. Could revisit when needed. At this moment for performance I favor something like #14997

@weihanglo weihanglo closed this Jan 1, 2025
@weihanglo weihanglo deleted the cache branch January 1, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-git Area: anything dealing with git Command-package S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants