Files
AFFiNE/packages/frontend/client/tests
DarkSky 15a7ac42fe perf(client,store): remove hot-path copies, scans, and redundant queries in sync and storage
Remove unnecessary allocations, scans, and repeated SQLite queries across document sync, media ingestion, and workspace table storage:

- Replace the full-page snapshot read and ID set scan in `next_available_media_block_id` with bounded O(1) read-only lookups against the root `blocks` map, keeping explicit block IDs in `ingest_media_into_doc_session` strict.
- Avoid cloning broadcast update payloads when a document is not in `LoadingRemote`, isolate per-update apply errors across live broadcasts and staged `DocLoaded` replays while triggering a single reconciliation and holding `remote_ts` on failure, skip unmanaged entries during timestamp sync, remove the unused `observed_remote_ts` state, and unify root, table, and page reconciliation dispatch in `doc_sync`.
- Encode `YjsTableDoc` state vectors and diffs directly via `y_octo::Doc::get_state_vector` and `encode_state_as_update_v1` instead of round-tripping full V1 updates.
- Cache per-document tombstone checks and monotonic clock watermarks within a single `BEGIN IMMEDIATE` write transaction in `sqlite/doc.rs`.
- Replace the two-query in-memory `HashMap` join in `list_unpushed_doc_clocks` with a single SQLite `LEFT JOIN` query while preserving `NaiveDateTime` comparison semantics.
2026-12-01 20:50:32 +09:00
..