Claude
|
63cf6646d0
|
perf: round 5 — CalDAV cursor streaming, SPA interning gaps, NC href prefix, per-request micro-allocs
Seven benchmark-gated changes (benches/ROUND5.md; BEFORE/AFTER bench +
equivalence gate each, rollback rule as ROUND2-4 — two intermediate
CalDAV shapes measured worse and were themselves rolled back before
shipping):
- CalDAV whole-calendar responses (REPORT no-range/sync-collection,
depth-1 collection PROPFIND, .ics GET): buffered double-residency →
ONE window-ordered scan (MIN(start_time) OVER (PARTITION BY ical_uid))
streamed through a PG cursor, pages cut at UID boundaries. TTFB
23.3→11.0 ms (2.1x), peak heap 14.2→8.0 MiB at 4k events / 45→24 MiB
at 12k, wall +9-15% (documented trade, ZIP-streaming class); both
multistatus and ICS byte-identical to the buffered output. Rejected
shapes kept in the doc: per-page GROUP-BY keyset (3-4x wall) and
per-uid ANY hydration (~20 µs/index descent).
- SPA listing interning gaps: folder/recent/favorites resources handlers
(and the WebDAV pseudo-root) called raw Arc::from per row for the
closed display set ROUND3 interned — now intern_display/intern_mime,
4→0 allocs/row, byte-identical Arc contents.
- NC PROPFIND child hrefs: username + parent path encoded once per
request instead of per child (543→165 ns/row, 13→4 allocs); native
WebDAV href drops its intermediate encode String.
- suggest enrichment: entity clone + field re-clones per keystroke row →
consume + move (166.5→126.8 µs/200 rows, 20→7 allocs/row).
- list_readable_by returns the cache's Arc (246→128 ns warm hit, 4→0
allocs) — deep Vec clone per DAV-selector request removed.
- CardDAV REPORT: borrowed props, reused href buffer, exact-size etag
quoting (3.04→2.34 ms per 5k-contact getetag poll).
- Auth span records: user_id.to_string() per request ×3 →
tracing::field::display.
Checks: cargo fmt, clippy --all-features --all-targets -D warnings,
cargo test --workspace (523 passed). Follow-ups (CardDAV streaming,
&[&str] id batches, ::text UUID casts A/B, share-landing join) recorded
in benches/ROUND5.md.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017aJu9ghvuT8WqC31ZEGTBA
|
2026-07-17 15:19:00 +00:00 |
|
Claude
|
12dc648cff
|
perf: round 4 — one-pass row paths, drive-selector cache, CalDAV single-parse, streamed Azure, batched hydration
Nine benchmark-gated changes (benches/ROUND4.md; every one ships with a
BEFORE/AFTER bench + equivalence gate, rollback rule as ROUND2/3):
- Row→entity path build: one-pass StoragePath::from_folder_and_name /
from_joined + normalize_storage_name_owned + alloc-free Display —
743→417 ns/file-row (1.78x), −5 allocs/row on every listing surface.
- WebDAV drive-selector: per-user readable_cache (single-flight, 30 s
TTL, explicit invalidation incl. membership + group changes) replaces
the grants join per request — 441 µs → 0.8 µs (~550x), 0 queries warm.
- CalDAV from_ical/update_ical_data: 8 full IcalParser runs per VEVENT
→ 1 (7.1x per PUT, 4.4x on 50-event imports); alloc-free split_vevents,
chunk scan without the whole-body uppercase copy (1.4x), borrowed-key
UID grouping (1.3x), REPORT props no longer cloned.
- PROPFIND emit: partition Vecs dropped (single-pass 404 list) + stack
rendered RFC 3339/2822 dates, sizes, quoted etags (common::fmt,
chrono-byte-identical, sweep-tested) on both DAV surfaces — 1.22x
per page, 17.9→12.0 allocs/row.
- Grant-listing hydration: calendars/address books/playlists batch
hydrate via = ANY($1) — 15 serial queries → 1 (~13x per sync poll).
- user-flags cache: get→insert → try_get_with single-flight (32→1
queries per cold herd).
- Azure downloads: whole-blob Vec buffering → streamed SDK pages —
TTFB 349→4 ms (87x), peak heap 480→1.9 MiB (254x) on 256 MiB blobs;
new OXICLOUD_AZURE_ENDPOINT_URL override (Azurite/bench hook).
- Face indexing: unbounded per-image tokio::spawn → core-count
semaphore, permit before blob read — peak heap 1175→176 MiB (6.7x).
Checks: cargo fmt, clippy --all-features --all-targets -D warnings,
cargo test --workspace (523 passed) + --features test_utils. hurl API
suite and dockerized integration DB not runnable in this environment —
left to CI.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017aJu9ghvuT8WqC31ZEGTBA
|
2026-07-17 13:48:37 +00:00 |
|