fontique: use getattrlistbulk for directory scanning on macOS - #6
Open
nicoburns wants to merge 2 commits into
Open
fontique: use getattrlistbulk for directory scanning on macOS#6nicoburns wants to merge 2 commits into
nicoburns wants to merge 2 commits into
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Stacked on #4. Uses the
getattrlistbulkcrate (MIT/Apache-2.0, macOS-only dep, published Jan 2026) so directory enumeration retrieves names, types, modification times, and sizes in batched syscalls instead ofreaddir+ onestatper entry.Key restructuring in
scan.rs:collect_font_filesnow returnsVec<(PathBuf, Option<FileStamp>)>— the walk produces cache stamps as a byproduct, soparse_files_cachedno longer re-stats every file (it only falls back tofs::metadatawhen the walk couldn't provide a stamp, e.g. explicitly-listed file paths).walk_dir: on macOS it usesgetattrlistbulk::read_dirrequesting{name, object_type, modified_time, size}(symlinks/unknown types fall back to themetadata-following generic path); elsewhere it keepsstd::fs::read_dir.The CoreText backend also drops its own duplicate
collect_fileswalker:library_font_dirs()now returns theLibrary/Fontsdirectories and passes them into the shared scan withmax_depth = 8, so those walks go through the bulk-syscall path too. The per-descriptorpath.exists()check (onestatper font) is removed since the scan skips missing files anyway.Net effect on warm start with the cache from #4: syscall count for the whole scan drops to roughly one
open+ a fewgetattrlistbulkcalls per directory, plus onestatper explicitly-enumerated font file path.Verified: clippy/check clean on
aarch64-apple-darwin,aarch64-apple-ios(wheregetattrlistbulkisn't pulled in), Linux, Windows, wasm, and a no-stdtarget; scan/cache tests pass. As with the rest of the stack, real timing needs measuring on a Mac.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/60a3d833a0894a73945c806adff1cbf3
Requested by: @nicoburns