optimize and reduce the time spent computing ahead/behind info#4399
optimize and reduce the time spent computing ahead/behind info#4399iAmWillShepherd merged 24 commits intocompare-branchesfrom
Conversation
|
I've finally been able to get most of the hard stuff isolated into this
Things that are nice
Things that need work
|
|
Would it be possible to run multiple ahead-behind checks at the same time so results show up faster? |
The current limit to concurrency is spawning Git processes - we have to spawn N Git operations to get the ahead/behind counts for N branches because Now, we could batch the |
iAmWillShepherd
left a comment
There was a problem hiding this comment.
I don't want to hold up this PR with the things, I've mentioned. So I'm gonna make the changes and merge.
| } comparisons to perform` | ||
| ) | ||
|
|
||
| if (newRefsToCompare.size === 0) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
app/src/lib/comparison-cache.ts
Outdated
|
|
||
| public get(from: string, to: string) { | ||
| const key = ComparisonCache.getKey(from, to) | ||
| return this.backingStore.get(key) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
The whole point of this component is to show ahead/behind info, let’s require a value for that prop

Fixes #4399
Some changes to reduce the work that Desktop does for crunching the ahead/behind counts:
ComparisonCachewhich uses the two refs as a lookup key - simplifies the app store workrequestIdleCallbackto prioritize this work behind everything elseisCrunchingstate as this isn't intended to ship as a UI featureThere's also a visual cue to indicate when it's working to help with debugging on my end, but I'll pull this out before merging.