Repository navigation
stop copying the error list on every add in ExecutionContext - #4532
Merged
bbakerman merged 1 commit intoNov 4, 2026
Merged
Conversation
Contributor
Test ReportTest Results
Code Coverage (Java 25)
Changed Class Coverage (1 class)
ImmutableKit — method details
|
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.
{ items(n: N) { b0: bad b1: bad ... b999: bad } }, 9.9 KB, where theItem.badfetcher throws (JDK 25, -Xmx4g):ExecutionContext.addErrorandaddErrorsappend by building a newImmutableListfrom the old one plus the new error, so collecting N field errors costs N^2/2 element copies into freshly allocated arrays. the error count is set by the request: aliases of any field that errors (an auth check rejecting an anonymous caller, a fetcher rejecting its arguments) times the length of the list above it, so a ~10 KB query can keep an executor thread busy for minutes. a plain loop of 200,000addErrorcalls takes 75 s before and 0.56 s after on a 1 GB heap.errors now go into an
ArrayListguarded by the existingerrorsLock, andgetErrors()returns anImmutableListcopy taken under the same lock. it is only read when results are assembled, and callers still get an immutable snapshot. the newExecutionContextTestcase adds 200,000 errors under@Timeout(10): it times out before the change (84 s) and passes in 1.5 s after.