Repository navigation
Conversation
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.
Why
A live frontend profile shows
MetricData.Consolidateallocating point arrays for aggregation inputs that already have the common resolution. Aggregation and arithmetic combination only read those arrays, so copying them increases allocation and GC cost without changing the result.Architecture
The change is local to expression evaluation.
AggregateSeriesandCombineSeriesnormalize their inputs through one internal read-only consolidation helper and write a separate output. Inputs that need resampling still useConsolidate; inputs already at the common step borrow their point slices while retaining separate metadata. The exportedNormalizebehavior stays unchanged for callers that may modify its returned data.Backend routing, replica-majority merging, caching, response serialization, and admission limits stay at their existing boundaries.
Before / after
Validation
ffd97cb5completed a bounded production A/B/A test on one frontend with three unchanged controls. Candidate and restored-stock measurements each cover ten minutes after five minutes of warm-up. No profiling or build work ran inside either measured window. Both phases recorded zero HTTP 5xx and no unexpected restarts; stock executable/configuration checksums, health and traffic registration were verified afterward. Temporary binaries, overrides, timers and build/profile files have been removed.Production result and remaining gate
This PR remains draft: allocation efficiency improved, but this run does not establish the required absence of a CPU/RSS peak or latency regression. These are operational measurements under changing real query traffic, not an isolated causal estimate.
Candidate: 17 October 2026, 15:02:46–15:12:46 CEST. Restored stock: 15:18:19–15:28:19 CEST. Request counts are 24,591 and 24,592 respectively. The candidate received 28.7% more merged upstream points in total and its peak point rate was 11.70M/s versus 4.00M/s. Partial responses already occur on all compared frontends; this test does not establish an improvement there.
Over each complete window, CPU per merged point is 0.606 → 0.427 µs and allocation is 120.7 → 80.3 bytes/point (stock → candidate). Adjusting for the three controls gives candidate/stock ratios of 0.652 for CPU/point, 0.639 for bytes/point and 0.943 for request p99. These comparisons support a possible efficiency improvement, but do not remove the query-mix confounder or clear the peak/latency gate. A better matched production comparison is required before making this ready or rolling it out.
A separate warm-up-only profile of the final candidate contained no allocation samples in
MetricData.Consolidate. Remaining allocation is dominated by protobuf decoding, expression result arrays and response-body reads; percentages vary substantially with query mix.