perf(reader): M31 字体路径记忆化(开书字体查找 35 目录 walk → 1 次 stat)+ 「· 读」徽标即时刷新

字体:find_font_rec/resolve_font 从 reader.c 抽到 app/font_resolve.c 并加进程内记忆化。
只缓存成功路径;命中后仍做一次 access() 校验(字库被删即重扫);没找到不缓存,
用户之后拷入的字库下次开书即可找到。顶栏「刷新」额外调 font_cache_invalidate(),
给「新拷入字库、旧字库仍在」一条显式失效路径。宿主实测:35 目录树 walk 0.026~0.54ms
(=300+ 次系统调用)vs 命中 0.001ms(1 次 access);开书路径每次省一次完整 walk。

徽标:副题格式化抽成 shelf_fmt_sub()(扫描与「刚读完置顶」共用一份实现),
promote_just_read() 改 ts 后立即重算这本的 sub/sub_folder,「· 读」不再等下次全量刷新。

回归:test_reader_core 6846、shelf_group_smoke 63(+8)、font_resolve_smoke 14 全绿;
build_reader.sh 0 warning;扫描缓存/进度语义未改。app.json 0.1.3/code4 → 0.1.4/code5。
This commit is contained in:
AskaEth committed 2026-11-10 13:39:32 +08:00
1 parent 0b30cdbafb
commit dc9bfdbdaf
12 files changed
+460 -53

No files matched your search

+4 -1
View File
@@ -1,5 +1,6 @@
# os.meow.reader 构建产物(不入仓)
/vendor/
# /vendor 不带尾斜杠:vendor 既可能是目录(真跑构建),也可能是链到主检出的软链(worktree 构建)。
/vendor
/reader
/os.meow.reader.mpk
/test/test_reader_core_host
@@ -7,6 +8,8 @@
/test/seg_smoke_host
/test/chapter_smoke_host
/test/shelf_group_smoke_host
/test/font_resolve_smoke_host
/test/font_resolve_bench_host
/test/shelf_scan_bench_host
/test/shelf_scan_bench_mipsel
/test/rdft_smoke_mipsel