Repository navigation
APFSearch 0.1.4 Preview
Pre-release中文
本次 Preview 主要降低大索引的内存占用,保留即时搜索和原有查询语义。发布前额外修复了深层查询解析的栈溢出问题。
- 查询解析改用显式栈,保留原有语法和工作量限制;不依赖增大线程栈或编译优化来避免深层嵌套崩溃。
- 主索引改为共享的 4,096 条列块,目录前缀按块复用,整数按实际范围紧凑存储,分页时才构造完整结果。
- 文件名和路径按块匹配,普通路径避免逐文件展开;保留 Unicode、跨路径边界、自然排序和完整正则语义。
- 派生缓存分段映射加载,更新复用未变化区段;增加损坏检测和旧快照保护。
- 链接核对在数据库事务外读取文件系统,复用父目录及挂载上下文;查询缓存采用分片、借用键和统一预算,内存压力时释放可重建缓存。
- 请求线程也纳入 CPU 预算,后台在块边界让出资源;合并已就绪的扫描批次,不增加固定等待时间。
实测: 同一份约 569 万条索引,五轮交替对照上一阶段紧凑候选版,驻留内存中位数从 3,026 MiB 降到 1,528 MiB(−49.5%),缓存恢复从 3.74 秒降到 3.19 秒。多数查询更快;五项超过原百分比门槛的差异为 6–76 微秒,小目录更新批次约增加 2.7 ms,作为本次阶段版本保留。该对照不是与已发布 0.1.3 的直接比较,也不代表所有电脑的表现。
升级: 保留现有 SQLite 索引数据、设置及公开协议。首次启动需从已有数据库重新生成派生搜索缓存,无需重新扫描文件;这次转换会单独产生一次读取和写入。
English
This Preview reduces large-index memory use while preserving search semantics.
- Replace recursive query parsing with explicit expression frames, preserving syntax and work limits without relying on larger thread stacks or compiler optimization.
- Store shared 4,096-slot column blocks, reuse directory prefixes, compact exact integer columns, and construct owned results at page boundaries.
- Match names and paths by block without expanding every ordinary path. Preserve Unicode, boundary matches, natural ordering and full regex subjects.
- Map validated metadata sections directly, reuse unchanged cache sections and retain old-reader consistency across updates and damaged-file recovery.
- Collect link observations outside database write transactions and reuse parent/mount context. Use borrowed cache keys, sharded access and shared byte budgets; release disposable caches on memory pressure.
- Include requesting threads in CPU admission, yield background work at block boundaries, and coalesce ready scan batches without a fixed delay.
Measured: Five alternating pairs on the same 5.69-million-entry corpus used 49.5% less median resident memory (3,026 → 1,528 MiB) and restored the cache in 3.19 s instead of 3.74 s, compared with the preceding compact candidate, not published 0.1.3. Most queries improved. Five percentage-gate misses added 6–76 microseconds; the small-directory update fixture added about 2.7 ms. These are accepted checkpoint differences, not a claim that every original target passed.
Upgrade: Existing SQLite metadata, settings and public protocol are retained. The first launch regenerates the derived search cache from the database without a filesystem rescan; this one-time conversion performs additional reads and writes.
Validation / 验证
GitHub CI passed on the exact release commit. / 发布提交的 CI 已全部通过。
- 316 Rust tests passed on both ARM64 and Intel under Rosetta, including unoptimized builds and a deliberately small 256 KiB parser-stack regression. Over 4,000 valid/malformed expressions match the frozen previous parser's syntax trees and errors. Strict Clippy passed.
- The final core passed 121 Swift service/content/file checks. The unchanged AppKit controller previously passed 84 checks; the rebuilt authenticated service/client/controller completed all final window runs, with stable results and unchanged history.
- Release-mode parsing batches show no meaningful slowdown: measured nonempty classes improved, with filename parsing at roughly 270 → 218 ns and empty input adding about 2 ns. This is parsing cost, not overall search latency.
- Replace a timing-dependent CI cache-publication test with explicit synchronization on both sides of publication, preserving the real writer and concurrent-delta assertions.
- All tested large-corpus metadata and result-page/order fingerprints matched. A signed production-client/XPC/AppKit fixture measured daily-query P95 of 1.20–7.13 ms through layout/display submission; physical input, IME and compositor presentation are excluded.
- The isolated service observed for 60.59 seconds after drain averaged below 0.001% CPU with zero measured interval I/O. Whole-volume event freshness, settled device I/O, physical Intel hardware and macOS 14 still require separate acceptance.
- Complete measurements and limits / 完整实测与限制
Downloads / 下载
Choose Universal.dmg if unsure. AppleSilicon is for M-series Macs; Intel is for Intel Macs. macOS 14 or later is required. Drag APFSearch into Applications and launch it there.
不确定机型时选择 Universal.dmg。AppleSilicon 适用于 M 系列 Mac,Intel 适用于 Intel Mac。需要 macOS 14 或更高版本;将 APFSearch 拖入“应用程序”后,从那里启动。
All included apps are Developer ID signed and Apple notarized. DMG containers are not separately notarized. SHA256SUMS.txt and downloads.json accompany all six downloads. Build number and public protocol remain 1; the derived cache has its own new format identifier.
六个安装包内的应用均经过 Developer ID 签名及 Apple 公证;DMG 容器未单独公证。附带 SHA256SUMS.txt 与 downloads.json。构建号及公开协议保持 1,派生缓存使用独立的新格式标识。