Repository navigation
perf(gateway): retain only the requested ordered session page - #171968
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
October 14, 2026 08:26
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
deleted the
steipete/perf-micro-session-filter-alloc-20260919
branch
October 14, 2026 08:54
vincentkoc
added a commit
that referenced
this pull request
Oct 14, 2026
…/plugin-memory-addon-presentation-20261014 * commit 'a8da8c92e3dbb21dd1441a30eb842fcd942e82b6': (52 commits) test(ui): await terminal reconnect fixture readiness (#171945) perf(gateway): retain only the requested ordered session page (#171968) test(gateway): cover automation run-alias placement lifecycle (#139313) fix(ci): retry FRV job listings with smaller pages after GitHub 5xx (#171952) fix(process): prevent false cleanup failures after CLI stdin closes (#171969) test(doctor): cover released updater advisory warnings (#157086) fix(ci): skip Testbox builds for known prose files (#171946) perf(sessions): remove redundant snapshot walks (#171964) fix(ci): skip plugin scaffold build for SDK instructions (#171944) fix(infra): preserve scheduler scope abort state after retirement fix: setup diagnostics can repair state without approval (#171960) perf(usage): avoid per-session admission churn during inventory (#171868) fix(ci): exclude documentation from extension lint scope (#171909) test(gateway): keep runtime-only compat flags out of live gateway config (#171953) docs: document ClawHub install telemetry opt-out (#114376) fix: recover completed chat replies after missed publication (#171766) refactor(ui): decouple session controller types from Lit (#171559) fix(gateway): settle worker reconciliation during busy shutdowns (#171843) fix(ci): ignore protocol prose in bundled check selection (#171908) fix(ui): align replacement lines and highlight inline diff edits (#171935) ...
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 15, 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
Paged
sessions.listreads allocate a full matching-roster array before slicing out a small page. This adds avoidable allocation when session publications invalidate a cached selection.User Impact
Session ordering, pagination, visibility, owner-first rows, totals, and owner/people facets remain unchanged. No configuration or storage changes.
Why This Change Was Made
The filter retains only the requested page when the resident selection is already ordered, and caps owner-first retention at its existing limit. It still scans every candidate for exact totals and facets.
sessions.resolvekeeps sorting its unordered candidate selections; transcript search still receives the entire filtered roster. Existing revision-aware presentation reuse remains the sole cache owner.Production LOC: +9 net (34 added, 25 removed). The extra counter/window contract preserves exact full-roster totals and unpaginated transcript search while deleting full-roster result retention and redundant page slices.
Evidence
git diff --checkpassed. Broad typecheck/build/suites delegated to PR CI. No Testbox lease.c72bbdea1c88855c2ef7fc97d006cfbee6eb312d, without reruns: https://github.com/openclaw/openclaw/actions/runs/38535170193.Measurement
Linux sandbox, 8,400 synthetic sessions, 24 profiles, 20% archived; 32 KiB V8 allocation sampling includes collected objects. Each fresh-selection case has five rounds of 1,000 operations after warming ordered resident metadata and identity facts. Full canonical output hashes match before/after for all four shapes, including exact totals, facets, and 60 owner-first rows.
These are medians at the production selector boundary with a fresh selection every operation, not end-to-end RPC claims. Exact counts/facets still require scanning all candidates; the change bounds temporary retained rows. The real WebSocket
sessions.listallocation harness also ran against fresh synthetic fixtures (8,400 seeded sessions + 2 driver sessions; 6,000 retained runs, 200 approval recovery records, 100 disabled cron jobs, 12 projects; approximately 250 MB session database). Basefa48c5f72db5versus this head, identical 32 KiB sampling, 500 requests/round. Sidebar/compact used five rounds each; dashboard used three. Fixture background events prevented the harness's quiet-drain assertion, so a lane-local driver used an identical fixed one-second post-RPC interval on both revisions. No production state was used.RPC limits: sidebar medians are confounded by startup heartbeats settling at different times; no end-to-end speedup is attributed to this patch. Compact CPU ranges overlap (base 6.141–6.947; head 5.804–6.964 ms/op). The initial dashboard CPU increase prompted one targeted reverse-order confirmation on settled, equally sized fixtures: unchanged head 6.090 ms/op (6.043–6.210), then base 7.489 (7.213–9.102), with no background events in either. Allocation medians were 3.576 MB/op head versus 3.626 base. The apparent CPU regression did not reproduce; neither direction supports a reliable RPC CPU speedup claim. Both original and confirmation results are reported here.
The attributable result is approximately 0.23 MB less allocation per fresh ordered selection with identical output; whole-Gateway production impact remains unmeasured.