Skip to content

Add caching of settings#958

Merged
Murmele merged 1 commit into
Murmele:masterfrom
AHSauge:fix/cache-show-changed-files-as-list
May 17, 2026
Merged

Add caching of settings#958
Murmele merged 1 commit into
Murmele:masterfrom
AHSauge:fix/cache-show-changed-files-as-list

Conversation

@AHSauge
Copy link
Copy Markdown
Contributor

@AHSauge AHSauge commented May 10, 2026

This fixes a performance regression introduced in #664.
The underlying code creates a QSettings object for each request, resulting in excessive file reads and slow-downs. By caching the value the cost of running RepoView::diffSelected is reduced by 10+ms (it seems to scale with the complexity of the commit)

@AHSauge AHSauge force-pushed the fix/cache-show-changed-files-as-list branch from d5ba660 to fe20254 Compare May 10, 2026 17:44
@AHSauge AHSauge changed the title Cache the ShowChangedFilesAsList setting in DiffTreeModel Add caching of settings May 10, 2026
@AHSauge
Copy link
Copy Markdown
Contributor Author

AHSauge commented May 10, 2026

I'm realising that it's quite easy to just cache any settings, so I rewrote the code to do that. As a consequence, this also improves performance outside of RepoView::diffSelected as well. For example, just hovering over a different commit will fetch 2x4 settings, each of them reading the settings file.

@AHSauge AHSauge force-pushed the fix/cache-show-changed-files-as-list branch from fe20254 to 6ff9f62 Compare May 10, 2026 17:56
Comment thread src/conf/Settings.cpp
Comment thread src/conf/Settings.h
The underlying code creates a QSettings object for each request, resulting in excessive file reads and slow-downs
@AHSauge AHSauge force-pushed the fix/cache-show-changed-files-as-list branch from 6ff9f62 to 9bc33b1 Compare May 15, 2026 14:08
@Murmele Murmele self-requested a review May 17, 2026 14:44
@Murmele Murmele merged commit 26848c2 into Murmele:master May 17, 2026
6 checks passed
@AHSauge AHSauge deleted the fix/cache-show-changed-files-as-list branch May 18, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants