Repository navigation
perf(gateway): skip discarded session event entries - #184097
Merged
steipete merged 2 commits intoOct 26, 2026
Merged
Conversation
Contributor
|
🦞👀 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. |
steipete
marked this pull request as ready for review
October 26, 2026 02:16
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
steipete
force-pushed
the
steipete/perf-micro-stream-session-broadcast-20260919
branch
from
October 26, 2026 02:31
8d40af0 to
8b7b3a3
Compare
steipete
deleted the
steipete/perf-micro-stream-session-broadcast-20260919
branch
October 26, 2026 02:44
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 26, 2026
* perf(gateway): skip discarded session event entries * fix(perf): use valid session row benchmark fixtures
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Streaming session events allocate entry tuples for every envelope field, including fields immediately discarded because the client uses session field references or omits the message body.
User Impact
Lower allocation and CPU in session-event projection, with identical wire payloads and unchanged live recipient authorization, delivery histories, and negotiated capabilities.
Why This Change Was Made
This builds on #183877, which shares row field ordering per audience. Filter property names before constructing retained entries. This removes temporary tuples for omitted fields without introducing a cache or another delivery path.
Object.fromEntriescontinues to preserve property order and own__proto__data properties. Runtime production LOC is unchanged; the added script is a reproducible owner benchmark.Evidence
Predeclared benchmark acceptance: identical payload digest with lower allocation and CPU. The committed
scripts/perf/session-event-envelope-measure.tsexercises the real projector and delivery planner with 65 synthetic recipients, mixed capabilities, staggered delivery histories, and changing row fields. Presentation is mocked; this is owner-level evidence, not whole-Gateway or authorization measurement.Base:
a5bfe043a403c8af06eaf03a454070347182e96f. Five interleaved runs per revision and measurement mode; 200 warm-up events and 3,000 measured events per run. Node 26.12.1 on macOS. CPU comes fromprocess.threadCpuUsage; allocations use a separate V8 sampling pass including collected objects. Hashing runs in a separate replay.One-minute host load ranged 27.7–32.3 in timing passes and 27.6–32.0 in allocation passes. All twenty runs produced payload digest
29b096a2c33c7144c68e753b80a7c7ee19a26f1e938bcde0b5e2d5a73b19128d.The existing audience regression fails on the base with four discarded-envelope enumerations and passes with zero after the change. It covers interleaved histories, legacy/delta/reference clients, and mid-broadcast revocation; it also checks own
__proto__data survives. Existing publication-authority snapshots cover exact wire strings, sharing changes, child visibility, and incognito exclusion.Validation: 27 focused tests passed across the audience, publication-authority, eager-import-closure, and PR-wrapper-source-closure files. Gateway test execution was 1.6 s for the changed audience file and under 5 s for publication-authority; wrapper startup/compiler preparation dominates wall time. The final audience rerun passed in 39.3 s wall time. Changed-file formatting/lint and the export-collision guard passed. Initial CI found invalid benchmark fixture types; the fixture now uses explicit typed row values, a string lifecycle revision, and structured assistant-message preview. The script typecheck passes, the fixture repair received a clean independent review, and all benchmark numbers above were rerun with the corrected fixture. Independent subagent review: clean, no actionable P0–P2 findings (autoreview route unavailable because its provider selector did not match the operator configuration). No whole-Gateway latency, GC, or retained-memory improvement is claimed. The lane's explicit fast-path exception applies to this allocation-only rewrite; no long Gateway stress campaign was run.