Repository navigation
perf(gpu): skip fontconfig for icon fonts and cache font resolution - #80
Merged
Merged
Conversation
resolve_fonts cost 39-43 ms on every open, about half of native first presentation: even with `[font] path` set it spawned `fc-match monospace` and, because the default mono is not a Nerd Font, an `fc-list` scan of every installed font. - When the first parseable `[font] path` / HYPRBURST_FONT font already has Nerd Font icons, fontconfig is skipped; only the hard-coded fallback paths that exist are kept for missing text glyphs. - Otherwise the fontconfig answer is cached in $XDG_CACHE_HOME/hyprburst/fonts, keyed by the font inputs and the fontconfig cache directories' mtimes, and looked up again when the key changes or a cached font no longer exists. resolve_fonts is now 1.1-2.2 ms. First-content p95 (n=30) drops by 40-51 ms for both frontends in performance and balanced, and every balanced-vs-performance first-presentation target now passes. docs/hotpath-findings.md records the re-measure and links the filed follow-ups.
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.
NUKE-111.
resolve_fontstook 39–43 ms on every open, about half of native first presentation. Even with[font] pathset, it spawnedfc-match monospaceand then ranfc-listover all 2875 installed fonts.Changes
[font] pathorHYPRBURST_FONTalready has Nerd Font icons (it has U+F269), fontconfig is skipped. Only the hard-coded fallback paths that exist are kept, for text glyphs the font lacks.$XDG_CACHE_HOME/hyprburst/fontsas plain text, written to a temp file and renamed. It is keyed by the config path,HYPRBURST_FONTand the family, plus the mtimes of~/.cache/fontconfigand/var/cache/fontconfig. It is looked up again when the key changes, a cached font is gone, or the file is corrupt.resolve_fontnow returnsresolve_fonts(..).primary.docs/hotpath-findings.mdgains an "After NUKE-111" section and the table of filed follow-ups.docs/hotpath-profiling.mdnotes the throwaway open needed before a run.Results (n=30 per cell, same procedure as #79)
resolve_fonts: 39–43 ms before. After: 1.1–1.4 ms when fontconfig is skipped, 1.4–2.2 ms on a cache hit. An uncached lookup still costs 30–40 ms, once after fonts change.Validation
cargo fmt --check.-D warnings, default features and--all-features.cargo test --all-targetswith default,hotpathandhotpath-allocfeatures: 323 / 324 / 324 passed, 9 new font tests.XDG_CACHE_HOME;touchon the fontconfig cache dir forces a new lookup.