Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Make git status parallelizable - #712

Merged
kuychaco merged 1 commit into
masterfrom
ku-get-me-the-status-STAT
Apr 27, 2017
Merged

kuychaco merged 1 commit into
masterfrom
ku-get-me-the-status-STAT

Conversation

@kuychaco

@kuychaco kuychaco commented Apr 27, 2017 •

Copy link
Copy Markdown
Contributor

So it turns out that while status attempts 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 and status operations.

Previously we had made an assumption that running git status while 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 while git status was running and had the index locked.

The changes made in this PR will result in performance gains by running status in parallel with other read operations, cutting down shell out times by the amount of time it takes to run a status command and also saving us on the cost of splitting up read operations because of a status write operation.

Before:
fullscreen_4_27_17__2_25_pm
☝️ Note that status is not run in parallel with surrounding read operations, which have been split up so that a write operation can occur

After:
fullscreen_4_27_17__2_30_pm

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
kuychaco force-pushed the ku-get-me-the-status-STAT branch from 34cd6da to 2eb62f2 Compare April 27, 2017 21:23
@kuychaco
kuychaco merged commit 5bdca1d into master Apr 27, 2017
@kuychaco
kuychaco deleted the ku-get-me-the-status-STAT branch April 27, 2017 21:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant