[WIP] Cut idle scans and avoid unchanged index writes on ARM64 #710

Closed
kayg wants to merge 19 commits from perf/arm64-fixes-2c into issue/perf-move
Owner

Idle quota accounting repeatedly walked every note, while task edits rewrote derived rows that had not changed. Native quota watching now updates usage when files change, retains a polling fallback, and bounds its reconciliation journal. Metadata updates preserve unchanged fields, task memberships and backlinks; a reader pool, borrowed property keys and smaller checkbox rows reduce repeated work. Fresh indexing batches plugin writes through the existing interface.

Invite validation performs the same covering lookup, constant-time secret comparison and legacy lookup for wrong, malformed, expired, revoked and used candidates within one read transaction. Tests cover lifecycle transitions and the validation operations. Primary FULL durability, receipt guarantees and file/directory sync barriers remain intact.

Supersedes draft #703 and remains stacked on #691 through issue/perf-move. References #686. Budgets and the performance harness are unchanged. Evidence belongs in issue comments; no measurements, logs or diagnostic probes are committed.

Performance acceptance remains blocked. At head 21180d0b2a82b8003cb1f1ee117a0a300ba5edaa, candidate warm task update p95 is 48.152, 43.162, 42.290 ms at 10k and 46.100, 43.995, 46.104 ms at 100k; all six exceed the unchanged 40 ms limit. First-touch at 10k is 24.177, 15.132, 22.687 ms and passes all three; at 100k it is 40.909, 39.967, 32.814 ms, with one miss. Cold growth is 6.079, 7.862, 8.566% at 10k and 7.966, 11.454, 22.262% at 100k. The 100k cold gate fails two of three repetitions and regresses in the third paired comparison. It is unresolved.

Candidate idle CPU is 0.000, 0.000, 0.000% across the three original 300-second windows. Long-note open p95 is 20.571, 20.747, 24.110 ms after preserving identical backlinks. Candidate invite max/min median ratios are 2.245, 2.119, 2.158, all below 2.5, but still above the near-1 goal. Application validation operations are equalized; the disk timing difference is not claimed eliminated.

Code checks passed: 1,185 workspace tests (20 ignored), clippy with warnings denied, fmt, both typechecks, 5,000 parser cases and 39 fsio tests. Web retains 14 existing warnings. Both before and after were rebuilt and alternated for three repetitions on the updated macOS 27.2 host after the required five-minute quiet period. All pre-reboot measurements are void. The draft remains blocked by task update and cold-index budgets. Full original outputs and noise tables are on issue #686.

Idle quota accounting repeatedly walked every note, while task edits rewrote derived rows that had not changed. Native quota watching now updates usage when files change, retains a polling fallback, and bounds its reconciliation journal. Metadata updates preserve unchanged fields, task memberships and backlinks; a reader pool, borrowed property keys and smaller checkbox rows reduce repeated work. Fresh indexing batches plugin writes through the existing interface. Invite validation performs the same covering lookup, constant-time secret comparison and legacy lookup for wrong, malformed, expired, revoked and used candidates within one read transaction. Tests cover lifecycle transitions and the validation operations. Primary FULL durability, receipt guarantees and file/directory sync barriers remain intact. Supersedes draft #703 and remains stacked on #691 through `issue/perf-move`. References #686. Budgets and the performance harness are unchanged. Evidence belongs in issue comments; no measurements, logs or diagnostic probes are committed. Performance acceptance remains blocked. At head `21180d0b2a82b8003cb1f1ee117a0a300ba5edaa`, candidate warm task update p95 is 48.152, 43.162, 42.290 ms at 10k and 46.100, 43.995, 46.104 ms at 100k; all six exceed the unchanged 40 ms limit. First-touch at 10k is 24.177, 15.132, 22.687 ms and passes all three; at 100k it is 40.909, 39.967, 32.814 ms, with one miss. Cold growth is 6.079, 7.862, 8.566% at 10k and 7.966, 11.454, 22.262% at 100k. The 100k cold gate fails two of three repetitions and regresses in the third paired comparison. It is unresolved. Candidate idle CPU is 0.000, 0.000, 0.000% across the three original 300-second windows. Long-note open p95 is 20.571, 20.747, 24.110 ms after preserving identical backlinks. Candidate invite max/min median ratios are 2.245, 2.119, 2.158, all below 2.5, but still above the near-1 goal. Application validation operations are equalized; the disk timing difference is not claimed eliminated. Code checks passed: 1,185 workspace tests (20 ignored), clippy with warnings denied, fmt, both typechecks, 5,000 parser cases and 39 fsio tests. Web retains 14 existing warnings. Both before and after were rebuilt and alternated for three repetitions on the updated macOS 27.2 host after the required five-minute quiet period. All pre-reboot measurements are void. The draft remains blocked by task update and cold-index budgets. Full original outputs and noise tables are on [issue #686](https://git.kayg.org/kayg/calternal/issues/686).
kayg added 19 commits 2026-10-27 21:21:33 +00:00
Cover list boundaries in multiline reference titles
Some checks failed
CI / web (pull_request) Failing after 50s
CI / server (pull_request) Successful in 1m17s
CI / rust (pull_request) Successful in 13m37s
5ed9dcc7e3
Keep unchanged backlinks when refreshing note metadata
Some checks failed
CI / server (pull_request) Successful in 1m44s
CI / rust (pull_request) Successful in 15m53s
CI / web (pull_request) Failing after 54s
21180d0b2a
Author
Owner

Closing: superseded by #716 (named in the PR body or comments). Branch kept.

Closing: superseded by #716 (named in the PR body or comments). Branch kept.
kayg closed this pull request 2026-11-04 13:04:30 +00:00
Some checks failed
CI / server (pull_request) Successful in 1m44s
CI / rust (pull_request) Successful in 15m53s
CI / web (pull_request) Failing after 54s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!710
No description provided.