Repository navigation
Optimize cold start and lazy-load offscreen QML - #216
Merged
Merged
Conversation
[Medium impact] The changes since the previous review appear safe to merge. SummaryThis PR reduces startup work by loading hidden QML only when needed, caching theme colors, and reducing repeated font, translation, and mount work.
Reviews (2) · Last reviewed commit: "Share sort order definitions between Pat..." · Reviewed by Greptile |
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cuts cold-start latency across
folio,folio preview, andfolio chooserby avoiding redundant startup work and deferring QML compilation/instantiation for offscreen dialogs, menus, overlays, and inactive folder views.Changes
src/theme.h,src/theme.cpp): Reuse Qt's already-loadedFcConfigGetCurrent()on startup instead of callingFcInitLoadConfigAndFonts(), keeping fresh fontconfig reloads for live font changes. Precompute derived WCAG/theme colors (folderFill,tooltipBackground,tooltipForeground,lighterBackground,accentForeground,secondaryForeground) once per palette load instead of running luminance and contrast bisection on every QML read.src/Main.qml,src/PreviewWindow.qml,src/FolderPane.qml,src/FolderColumns.qml,src/Sidebar.qml,src/PathBar.qml,src/Glyph.qml): LoadHelpOverlay,FileMenu,PlaceMenu,DriveMenu,SortMenu, all five pane dialogs (MountPrompt,RenameDialog,ConfirmDialog,FormatDialog,ClashDialog),PreviewPane, and inactive folder views (FolderGrid/FolderList/FolderColumns) viaLoaderby relative URL so they are neither compiled nor instantiated at startup. Load rare plugin SVGImages lazily inGlyph.src/translator.h,src/translator.cpp): Key translations by UTF-8QByteArrayand look up withQByteArray::fromRawData()to avoid heap-allocating aQStringon everytr()/qsTr()call; skip openinglocales.jsonwhenOMARCHY_PATHis unset.src/places.cpp): Skipstatvfs()(isReady()/bytesAvailable()) on pseudo, loop, zram, and system mounts inPlaces::readMounts(), and fetchg_volume_monitor_get_mounts()once permountsRead()instead of once per drive.Benchmarks
Measured offscreen on Release builds:
Theme::followSystemFont()Windows()(compileMain+FolderPane)Windows::open(home)PreviewWindowcold load1000×Theme derived colors