PERF: Apple Notes bridge APPEND is 590 ms p50 / 5.7 s worst burst; profile and fix on HDD #550

Open
opened 2026-09-30 18:22:06 +00:00 by kayg · 0 comments
Owner

Found by notes-bridge (#428, 2026-09-30)

The Apple Notes IMAP bridge is GO on correctness, but the local APPEND latency (a note saved from Apple Notes) is p50 590 ms / p95 1,525 ms on average, and p50 4,357 / p95 5,762 ms in a burst (worst case). There is no baseline yet. Evidence: docs/perf/notes-bridge-2026-09-30.json on job/notes-bridge (eaa442c09); harness bench/notes-bridge.py.
Job (perf round, after merge round 4 lands notes-bridge):

  • Measure on the perf VM, on the hard-disk rule (#549): fio proof, cold and warm.
  • Profile where the APPEND time goes: MIME parse, HTML→Markdown projection, the diff/merge against the stored note, the file write + fsync, the index update, and the IMAP response. Check for per-APPEND full re-reads of the mailbox or note folder, and for serialisation on a global lock (the burst case).
  • Budget: APPEND p95 ≤ 150 ms warm and ≤ 400 ms cold on HDD, and a burst of 50 edits with no p95 above 1 s.
  • Fix the causes, one commit each, with before/after numbers. Per-crate Rust gates (calternal-imap and any crate touched). Add the profile to bench/run.sh and the baseline to docs/perf/.
## Found by notes-bridge (#428, 2026-09-30) The Apple Notes IMAP bridge is GO on correctness, but the local APPEND latency (a note saved from Apple Notes) is **p50 590 ms / p95 1,525 ms** on average, and **p50 4,357 / p95 5,762 ms** in a burst (worst case). There is no baseline yet. Evidence: `docs/perf/notes-bridge-2026-09-30.json` on job/notes-bridge (eaa442c09); harness `bench/notes-bridge.py`. **Job (perf round, after merge round 4 lands notes-bridge):** - Measure on the perf VM, on the hard-disk rule (#549): fio proof, cold and warm. - Profile where the APPEND time goes: MIME parse, HTML→Markdown projection, the diff/merge against the stored note, the file write + fsync, the index update, and the IMAP response. Check for per-APPEND full re-reads of the mailbox or note folder, and for serialisation on a global lock (the burst case). - Budget: APPEND p95 ≤ 150 ms warm and ≤ 400 ms cold on HDD, and a burst of 50 edits with no p95 above 1 s. - Fix the causes, one commit each, with before/after numbers. Per-crate Rust gates (`calternal-imap` and any crate touched). Add the profile to `bench/run.sh` and the baseline to `docs/perf/`.
Sign in to join this conversation.
No labels
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#550
No description provided.