Repository navigation
fix(sqlite): speed up read-only snapshot startup - #144448
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 7:09 PM ET / 23:09 UTC (Revision 2). ClawSweeper reviewWhat this changesBuilds the short-lived SQLite snapshot process separately in production and tests so it loads less shared code at startup. Merge readiness✅ Ready for maintainer review This remains a useful, focused optimization beyond the earlier merged import reduction. No actionable defect was found, and the protected maintainer PR should remain open for normal landing. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw creates private SQLite snapshots for read-only inspection through a separate process. The build configuration packages that process, while the parent retains responsibility for launching it, interpreting its result, and cleaning up snapshots. flowchart LR
A[Snapshot request] --> B[Parent orchestration]
B --> C[Standalone snapshot process]
D[SQLite database] --> C
E[Production and test builds] --> C
C --> F[Private snapshot and result]
F --> B
B --> G[Read-only inspection and cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +55, Other +36. Total +91 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the snapshot executable independently bundled while preserving shared parent ownership, stable worker paths, and existing snapshot semantics. Do we have a high-confidence way to reproduce the issue? Not applicable as a correctness regression: this is a performance optimization supported by a reported native-process comparison, which was not rerun here. Is this the best way to solve the issue? Yes. Separating the existing short-lived executable at the build owner avoids adding runtime caches, pools, or competing snapshot implementations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against df9cb08fd845. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* perf(sqlite): bundle read-only snapshot child independently * test(build): retain standalone worker declaration coverage
What Problem This Solves
Resolves a problem where each short-lived read-only SQLite snapshot process loads shared runtime chunks containing work it does not need. Update tests launch these processes repeatedly, making cold startup a material part of their runtime.
Why This Change Was Made
Emit the existing snapshot executable as one standalone bundle in both production and the invocation-owned test compiler. One entry classification removes it from the shared executable graph, while parent orchestration and SDK code retain shared runtime identity. The stable worker path, native process protocol, dependency policy, schema inlining, lazy package loading and artifact verification remain intact.
User Impact
Less cold loading for existing read-only snapshots. Runtime implementation, storage semantics and worker/shard counts are unchanged. The standalone artifact duplicates some helpers used by other outputs; it is 155.8 KB (39.4 KB gzip), which is not a measurement of incremental package size.
Evidence
The unchanged complete update-CLI file plus native sync/async sibling passed all 503 cases in each local arm:
The candidate saved 41.46s (7.6%) against the nearer restored control. The first two arms had a 19m36s pause, and the original controls differed by 77.46s; this is not a guaranteed whole-CI or cross-platform saving. Test inventory/order, assertions, dependencies and execution settings were unchanged. This comparison is pinned to its earlier source base; the rebased candidate was subsequently validated against current source and its frozen dependencies.
The earlier native-child comparison reduced the local import closure from 47 files to one. The final production build also emits a single-file worker; real built sync/async SQLite smoke checks passed. All 479 focused owner/native/config cases passed with one existing platform skip, along with five selected source-freshness/refusal/artifact checks, the normal production build, complete changed-file gates and independent P2 review.
Build-tooling delta is +36 lines for the dedicated executable boundary and its two consumers; existing config guards gain 32 net lines. Runtime implementation delta is zero. No new settings, process pool, cache or test-only runtime seam. Exact-head CI remains required before landing.