Repository navigation
Reduce MCP query view allocations and tighten feedback validation - #2049
Open
callumalpass wants to merge 1 commit into
Open
callumalpass wants to merge 1 commit into
callumalpass wants to merge 1 commit into
Conversation
callumalpass
enabled auto-merge
November 28, 2026 14:28
This branch has not been deployed
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.
Changes
Measurements
Eight alternating base/head pairs, reversing order each pair. Each process used five independent OAuth clients, pg-mem, the real MCP HTTP handler and view model, and a stubbed upstream. Three warm-ups per case preceded one timed batch and one separately allocation-sampled batch. Each pages batch made two waves of five requests. At 10k records the offsets cover the collection once. The 32-record control reads the small page ten times. Mixed batches run one query of 25 rows alongside one read, create, update and connection listing. All 16 processes checked expired/revoked token rejection, cross-connection refusal, query row counts, view columns and type. All finished with five route requests and one editor configuration request.
Each cell contains median / nearest-rank p95 across eight processes. At this sample count p95 is the maximum. View time sums just the synchronous model work across query responses. Sampled MiB covers allocations across the whole batch. Median timings are rounded to three decimals.
At 10k, the view step used 53% less median time on paginated results and the total paginated batch sampled 8.6% fewer allocated bytes. The median paginated batch was 1.3% faster. Mixed median and p95 wall times rose at both sizes. These local measurements isolate the largest gain in query-page preparation. Production latency remains unmeasured.
Reproduce
From the PR checkout with Node 22.22.0 and pnpm 11.15.1, run the following in Bash. Both revisions use the same benchmark driver and dependency build. Run on one host, sequentially.
Group the JSON lines by side, size and workload. Take the median and nearest-rank p95 of
batchMs[0],viewMsandsampledMiB[0].Verification
pnpm ci:localpassed on Node 24.22.2. The selected node gates included the full workspace build, typecheck and test commands.pnpm e2e --no-prepareagainst the locally built server. Sign-in, registration, record read, create/update on disk and post-sign-out refusal passed.