Files
codebase-memory-mcp/tests
Andrew Hundt 762188cd63 perf(store): bulk insert graph-buffer edges
Add a transaction-scoped edge batch helper so replacement graph flushes can reuse store batching without nesting BEGIN/COMMIT inside the active flush transaction.

Use a temp-table + set-oriented INSERT ... SELECT ... ON CONFLICT path for high-fanout direct-ID edges, preserving json_patch merge semantics and reusing the existing ST_DELTA_EDGE_BULK_MIN threshold.

Switch cbm_gbuf_flush_to_store from per-edge INSERT ... RETURNING to the new transaction-scoped batch body after remapping valid edge endpoints. Orphan-edge skipping and flush rollback/bulk-mode boundaries stay unchanged.

Measured on the focused FastAPI single-file canary: gbuf edge insertion dropped from 5232ms to 289ms, replacement flush from 8099ms to 3387ms, and total index_repository from 17356ms to 12393ms.

Validation: git diff --check; scripts/check-source-safety.sh; final ASan/UBSan rebuild; store_edges 26 passed; graph_buffer 67 passed; store_bulk 3 passed; focused incremental canary passed; product build passed. Full incremental suite also passed 161 tests on the pre-final allocation micro-change binary.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
2026-07-05 07:12:56 -04:00
..
2026-06-03 02:13:30 +02:00