This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
Make git status parallelizable - #712
Merged
Merged
Conversation
So it turns out that while `status` writes to the index (for caching/perfomance purposes), it does not write if the index is locked. Therefore we don't have to worry about contention between status operations and can run them in parallel with other operations.
kuychaco
force-pushed
the
ku-get-me-the-status-STAT
branch
from
April 27, 2017 21:23
34cd6da to
2eb62f2
Compare
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
So it turns out that while
statusattempts to lock the index in order to write to it (for caching/performance purposes), the command still completes successfully even if it can't. Therefore we don't have to worry about contention between status operations and can run them in parallel with other read andstatusoperations.Previously we had made an assumption that running
git statuswhile the index was locked would cause a fatal git error because we had observed this being the case when the reverse occurred, i.e. a command accessed the index whilegit statuswas running and had the index locked.The changes made in this PR will result in performance gains by running
statusin parallel with other read operations, cutting down shell out times by the amount of time it takes to run astatuscommand and also saving us on the cost of splitting up read operations because of astatuswrite operation.Before:

☝️ Note that
statusis not run in parallel with surrounding read operations, which have been split up so that a write operation can occurAfter:
