Worker: write only what changed, sample downloads less

- The models folder scan compared nothing and rewrote local_folders on every
  run (delete all, insert all, each folder's file list included), every 2
  minutes by default: ~1 MB of SQLite writes per scan with three large import
  folders. It now inserts new folders, updates changed ones and deletes gone
  ones; unchanged rows (compared by counts, commit and the stored JSON text)
  aren't written.
- Download progress and the speed limit share one ProgressSampler. A file found
  complete isn't stat'ed or its hf metadata re-read again during the run, and
  with every file complete the partial files aren't listed. Before, every
  sample looked at every file, 5 times a second with a speed limit set. The
  check after hf exits still looks at every file.
- A benchmark's phase is written when its step changes, not for every
  progress line BetterBench prints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EooZ9biu7kFNB4eDJrwQc5
This commit is contained in:
Claude committed 2026-11-01 21:01:11 +00:00
1 parent d10a491042
commit d58bff3437
8 files changed
+260 -8

No files matched your search

+4
View File
@@ -26,6 +26,10 @@ step 1 (Hugging Face downloader) is released as a minor version.
loaded once and cached instead of being part of each page, the ⌘K search loads when you first
reach for it, and the endpoint pages no longer include database code. The painting is drawn once
per page view instead of twice, and at most once per frame while the window is resized.
- **Less disk activity**: the models folder scan writes only folders that changed (it rewrote
every found folder's file list each time, every 2 minutes by default), and download progress
no longer re-checks files that are already complete, which matters on network shares. A
benchmark's current step is written when it changes, not for every line BetterBench prints.
## [0.16.0] - 2026-10-30