cache remotes for repository in GitStore to avoid lookups
- Dominant language
- TypeScript
- Stars
- 21.8k
- Forks
- 10.5k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 25
Description
As part of investigating opportunities for performance improvement, I pointed out that we call `getRemotes` in several places in the app and do not cache these values.
https://github.com/desktop/desktop/blob/bee4c6bb74d8060c6514fad3ab6a3f366d4c8eaf/app/src/lib/stores/app-store.ts#L841
https://github.com/desktop/desktop/blob/bee4c6bb74d8060c6514fad3ab6a3f366d4c8eaf/app/src/lib/stores/app-store.ts#L4921
https://github.com/desktop/desktop/blob/bee4c6bb74d8060c6514fad3ab6a3f366d4c8eaf/app/src/lib/stores/git-store.ts#L905
https://github.com/desktop/desktop/blob/bee4c6bb74d8060c6514fad3ab6a3f366d4c8eaf/app/src/lib/stores/git-store.ts#L1067
https://github.com/desktop/desktop/blob/bee4c6bb74d8060c6514fad3ab6a3f366d4c8eaf/app/src/lib/stores/git-store.ts#L1104
https://github.com/desktop/desktop/blob/bee4c6bb74d8060c6514fad3ab6a3f366d4c8eaf/app/src/lib/stores/git-store.ts#L1435
Remotes change infrequently, and Desktop does very little work itself to add or remove them, so I think we can cache these values to reduce the work of spawning processes when we need to inspect the remotes for a repository. This will be more beneficial for our Windows users, because of the overhead of spawning processes is more expensive there.
Contributor guide
Assessment
This issue has not been assessed yet.