Repository navigation
use the index state to detect whether there are conflicted files present - #7476
Merged
Merged
Conversation
shiftkey
force-pushed
the
only-look-for-stash-conflicts-sometimes
branch
from
May 7, 2019 19:36
25ea40d to
fd7bc61
Compare
outofambit
reviewed
May 7, 2019
outofambit
reviewed
May 7, 2019
outofambit
reviewed
May 7, 2019
This reverts commit fd7bc61.
outofambit
approved these changes
May 8, 2019
outofambit
left a comment
Contributor
There was a problem hiding this comment.
this looks great! i know there's a little more we could do to make the file status checking faster, so @shiftkey let us know when you're done looking into that. i think this is fine to merge as is since it should still be a marked improvement over current performance.
| export async function getRebaseInternalState( | ||
| repository: Repository | ||
| ): Promise<RebaseInternalState | null> { | ||
| if (!enablePullWithRebase()) { |
Member
Author
|
@outofambit I'm going to revisit the file status checking after the collection of outstanding PRs are reviewed/merged/available on beta, because at this point I want to avoid looking at issues that are resolved elsewhere. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
Related to #7464
Description
This PR tunes a code path inside
getStatusthat was introduced as part of the new stash flow in #7380. The original implementation was a naive "do we have changes?" check and it turns out thatgit diffis rather expensive when dealing with a large number of working directory changes.Here's a profile of a refresh in the
nodejs/noderepository when all of the files are marked for deletion (I've highlighted the overall timing):You'll note that
getFilesWithConflictMarkersandgetBinaryPathstake a combined 4.7 seconds, or about 85% of the overall 5.5 seconds it takes to refresh.You can also see these fire again outside the scope of the refresh, but I've opened #7475 because I think that work is unnecessary:
The fix I settled on was to look at the index for unmerged files if we cannot detect a merge or rebase in progress. If we do not detect any unmerged files in the index, I believe we can skip doing any
git diffinvocations and save time.Release notes
Notes:
[Improved] checks for stashing conflicts only when the right state found in index