Skip to content

core: load configs from the vfs mirror to enable the qml disk cache - #1049

Open
bbedward wants to merge 1 commit into
quickshell-mirror:masterfrom
bbedward:fix-qs-cache
Open

bbedward wants to merge 1 commit into
quickshell-mirror:masterfrom
bbedward:fix-qs-cache

Conversation

@bbedward

@bbedward bbedward commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

As noted in the codebase and #735, the QML disk cache doesnt work with qs: URLs.

This makes vfs/<id>/qs the import root and mirrors the full config there. Normal dirs are symlinked directly; dirs with generated files like qmldir, //@ if, or qml.json are mirrored with symlinks plus the generated files. Generated files are only rewritten when their contents change so cache mtimes stay valid.

The URL interceptor also canonicalizes config QML/JS/qmldir paths into the mirror so the same document cant be loaded under both qs: and file: URLs.

If the VFS cant be created it falls back to qs: like before.

On DMS this drops warm launch to "Configuration Loaded" from 1.28s to 0.77s and RSS by ~40MB.

Verify with QT_LOGGING_RULES=qt.qml.diskcache=true; the second run should be silent.

@bbedward
bbedward force-pushed the fix-qs-cache branch 2 times, most recently from 52087cf to 8d484a9 Compare September 22, 2026 00:05
@hkoeck

hkoeck commented Sep 26, 2026 •

Copy link
Copy Markdown

Tried this on Fedora 44 and it works well - startup roughly halves and the disk cache is finally being used. I'm running it as my actual shell now.

Measured in normal service startup, "Launching config" to "Configuration Loaded", with DankMaterialShell as the config (712 .qml, ~233k LOC) and //@ pragma DiskCache added:

runs median
fae96f1 (parent) 2.54 / 2.48 / 2.42 ~2.5s
e26a7c0 (this PR), warm 1.36 / 1.37 / 1.35 ~1.36s
0.3.1 (Fedora package) 2.57 / 2.52 / 2.55 ~2.55s

Both local binaries are built from the same tree with identical flags, and the packaged build lands on the parent, so nothing here is an artefact of my toolchain. Standalone, outside the service, the same pair gives 2.6s vs 1.35s.

QT_LOGGING_RULES=qt.qml.diskcache=true tells the same story. On the parent it is 1103 lines of Error loading "qs:@/qs/shell.qml" from disk cache: "File has to be a local file.", which is #735 verbatim. On this branch the URLs are file:///run/user/1000/quickshell/vfs/..., the count drops to 56 on the first run, and once the cache is fully written it is silent, exactly as you describe. It takes a couple of runs that are allowed to live a few seconds - killing the process right after "Configuration Loaded" leaves the lazily loaded settings and modal components uncached, which looks like a residue until you wait.

The first run costs 4.5s while the cache is built, then it settles. ~/.cache/quickshell/qmlcache went from 126 stale files, none written since the config moved to the embedded layout, to over 1200.

Ryzen 7 3700U (8 threads), Qt 6.11.2. No crashes, QML errors or unexpected restarts since I switched to it - though that is hours, not weeks.

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