cache repository refresh to reduce load when refreshing takes time #7601
Labels
performance
Relating to things affecting performance
tech-debt
Issues and pull requests related to addressing technical debt or improving the codebase
As part of investigating performance improvements, I noticed two cases where users may find the app running multiple refreshes. Here's a log to illustrate what this looks like with tracing enabled:
Two particular cases stood out around the user interacting with the app:
On systems with slow I/O or complex repositories (also Windows will see this more acutely), the overall refresh operation may take multiple seconds. Adding more in-flight refreshes will only slow down the first refresh, leading to a sort of "self denial of service" in the app if the user is able to trigger these continually by interacting with the app.
To reduce the impact of Desktop's refreshing work we could track the current refresh operation in a per-repository cache, and if a refresh is active then a new refresh should not be started.
For reference we did something similar in #7501 for the pull request refresh:
desktop/app/src/lib/stores/pull-request-store.ts
Lines 71 to 94 in bee4c6b
The text was updated successfully, but these errors were encountered: