繁體中文

效能優化

閒置時少做白工,Usage 更省 CPU 與硬碟

電腦明明沒在操作 Usage,CPU 與硬碟卻不該一直忙著翻舊帳。這版把背景整理改成像圖書館只查看剛歸還的書:它會依 FSEvents(macOS 告知哪些檔案改過的通知)只挑出有變動的檔案。於是它只讀取有變動的 Claude、Codex 工作階段 JSONL(每行存一筆資料的紀錄檔),不再每次更新都重翻成千上萬個檔案;仍會定期全面檢查,避免漏掉變更。啟動時,價格表與更新檢查也會尊重既有快取(把查過的結果暫存起來直接用)的有效期限,不再每次重抓。Codex 的限流資料會共用檔案索引,SQLite(放在單一檔案裡的小型資料庫)檔沒變就不讀;解析快取更分成 32 份,活躍工作階段只改自己的那份。結果是閒置時明顯減少 CPU 與硬碟讀寫,啟動也少做無謂工作。

English

PERF

Usage stops doing busywork while idle, saving CPU and disk activity

When you are not even using Usage, your CPU and disk should not be stuck riffling through old records. This release makes its background housekeeping work like a library checking only books that were just returned: FSEvents, macOS notifications about changed files, tells it which files to inspect. It now reads only changed Claude and Codex session JSONL logs, rather than re-walking and checking thousands of files on every refresh; a full scan still runs from time to time as a safety net. On startup, the pricing table and update check now honor their existing cache, saved results that remain valid for a while, instead of downloading again every time. Codex rate-limit reads share the file index, unchanged SQLite database files are skipped, and the parse cache is split into 32 buckets so an active session rewrites only its own. The result: substantially less idle CPU and disk I/O, plus less needless work at launch.

原始 CHANGELOG

Original changelog閒置時少做白工,Usage 更省 CPU 與硬碟
**Idle CPU and disk I/O cut significantly across the board.** History scanning now uses FSEvents-reported paths to stat only changed files instead of re-walking and stat'ing every Claude/Codex session JSONL (thousands of files) on every refresh tick; a full rescan still runs periodically as a safety net. Startup no longer unconditionally re-downloads the pricing table or checks for updates — both now respect their existing cache freshness windows. Codex rate-limit reads reuse the same file index instead of re-scanning session directories, and SQLite reads (thread metadata, rate limits) are skipped entirely when the underlying database file hasn't changed. The on-disk parse cache is now sharded into 32 buckets so a single active session only rewrites its own shard instead of the whole multi-megabyte cache file.