desktop / desktop/desktop

cache remotes for repository in GitStore to avoid lookups

Open
#7,599 0 comments 0 reactions 0 assignees View on GitHub
performance tech-debt windows
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.