Repository navigation
perf(gateway): streamline config reload comparison - #152279
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: blocked before merge. Reviewed September 18, 2026, 8:07 PM ET / September 19, 2026, 00:07 UTC. ClawSweeper reviewWhat this changesThe PR reduces repeated work during Gateway configuration comparison by collecting changed paths in one array and avoiding unnecessary refinement-prefix scans. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this is a focused optimization absent from current main and the latest release. Source review found no introduced correctness defect, and the protected maintainer label rules out automated closure. Priority: P3 Review scores
Verification
How this fits togetherThe Gateway compares previous and candidate configuration snapshots to identify changed settings. Its reload planner uses those paths to select hot updates, subsystem reloads, or a Gateway restart. flowchart LR
A[Previous configuration] --> C[Compare configuration]
B[Candidate configuration] --> C
D[Registered reload boundaries] --> C
C --> E[Ordered changed paths]
E --> F[Reload planner]
F --> G[Hot update or restart]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +8. Total +8 across 1 file. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the existing comparison and reload-policy owners while reducing temporary allocations and unnecessary scans without changing their output contract. Do we have a high-confidence way to reproduce the issue? Not applicable: this proposes a performance optimization rather than a broken-behavior fix. Repeated scans and intermediate arrays are evident in current source; timing results were not independently reproduced. Is this the best way to solve the issue? Yes: a private accumulator and reused object classifications narrowly reduce work while preserving the exported interface and existing reload decisions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4d27b1a65874. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit 'ca69b4d25dfcd488acc6ba1d878e4b4252f40cd2': (325 commits) perf(gateway): streamline config reload comparison (#152279) fix(xai): reject invalid UTF-8 OAuth responses (#111737) fix(release): accept waived advisory performance evidence for stable publication (#152290) fix: deliver watcher results while other sessions are busy (#152287) perf(media): reuse attachment filename classification (#152274) refactor(build): reuse forwarded option scanning (#152293) chore(diagnostics-otel): revert unapproved duration-bucket merge (#152292) fix: stop chat media reads after access changes (#152219) fix(test): use Gateway WebSocket transport in network fixtures (#152143) improve: retain quota refresh evidence from successful CI runs (#152173) improve(gateway): reduce memory used by session selection (#152260) perf(agents): use keyed subagent capability lookups (#152263) refactor(matrix): centralize media metadata assembly (#149128) chore(ui): refresh control ui locales (#152276) feat: open Crabbox apps beside the conversation (#152094) refactor: simplify worker and model fallback handling (#152268) perf(codex): reconcile session catalogs incrementally (#152257) fix(ui): keep submitted prompts visible across session startup (#152241) perf(sessions): move automatic maintenance database work to workers (#148630) fix: preserve reply metadata through outbound preparation (#152231) ...
* commit '912b21b98581c0be3baad87fe3686b64d69fffeb': (191 commits) perf(process): reduce allocation while processing command output (#152261) fix(ui): collapse duplicate previews when a page opens in multiple tabs (#152281) fix(test): run local Gateway tests behind protected exec egress (#152318) fix(node-host): avoid blocking configuration reads (#151411) fix(qa-lab): prevent Evidence Archive filters from overflowing (#152123) test: stabilize Docker scheduler signal fixtures on macOS (#152301) fix(ui): close stuck submenus when moving between menu rows (#152317) fix(ui): preserve question drafts and pending submissions (#152096) fix(release): recognize 7.34 fs-safe contract (#152326) chore: retire CLAUDE.md files fix(ui): release queued input after completed chat runs (#152299) improve(tooling): reduce commit formatting resource use (#152297) feat: show mentioned sessions in Involving me (#152083) perf(tasks): reuse prepared audit summaries (#152294) fix(daemon): preserve LaunchAgent rollback bytes and modes (#152195) fix: stop chat layout changes from loading extra history (#151726) perf(gateway): streamline config reload comparison (#152279) fix(xai): reject invalid UTF-8 OAuth responses (#111737) fix(release): accept waived advisory performance evidence for stable publication (#152290) fix: deliver watcher results while other sessions are busy (#152287) ...
What Problem This Solves
Config reload comparison repeatedly scans refinement prefixes and allocates child result arrays even when those operations cannot affect the result.
User Impact
Config comparison performs less repeated work while preserving the exact changed-path ordering and reload decisions, including duplicate dotted paths and whole-section reload boundaries.
Why This Change Was Made
The existing diff owner now appends into one result array, prepares plain-object facts once, and examines refinement prefixes only when one side is an object. Array structural comparison, root labels and derived Talk-owner handling stay unchanged. No cache, trie, configuration policy or persistence change is introduced. The private accumulator helper adds eight net production lines.
Evidence
Baseline and candidate each passed the same 599 Gateway tests across config reload, transcript reload policy and Telegram reload policy. The complete changed-file gate and independent Codex P2 review passed. Separately retained untimed captures preserve exact ordered paths and complete typed reload plans for 13 full comparison cases and 1,352 edge cases; an independent offline audit passed.
Seven fixed rounds retained 182 batch observations and 1,198,400 timed comparison calls. Ordinary clone/leaf/bulk mean wall time changed from 0.202/0.207/0.219 ms per call to 0.020/0.019/0.022 ms; corresponding process CPU changed from 170.3/168.7/177.0 microseconds to 19.2/18.2/18.8 microseconds. Whole-section add/remove and larger fixtures also improved in aggregate.
All adverse samples remain: tiny no-op mean wall time increased from 0.523 to 0.626 microseconds, and Talk's candidate-first subset increased 17.49% despite a favorable overall mean. Eleven adverse paired wall/CPU observations were retained. The test-suite wall time also grew on the loaded shared host and is not used as evidence of function performance.
These are warm owner-boundary observations with shared-host scheduling/GC effects, not end-to-end Gateway latency or allocation measurements. Full parity was asserted before timing and captured separately; timed loops consumed path lengths rather than retaining every result graph.