[JENKINS-76028] Add NavigableMap support for CopyOnWriteMap.Tree#10997
Merged
krisstern merged 1 commit intojenkinsci:masterfrom Sep 2, 2025
Merged
[JENKINS-76028] Add NavigableMap support for CopyOnWriteMap.Tree#10997krisstern merged 1 commit intojenkinsci:masterfrom
krisstern merged 1 commit intojenkinsci:masterfrom
Conversation
ad1ab81 to
b63bd98
Compare
b63bd98 to
bdad5a8
Compare
Optimize AbstractLazyLoadRunMap's search, firstKey, lastKey methods. Simplify wrapping with BuildReferenceMapAdapter by introducing single configuration class BuildReferenceMapAdapter.Resolver. Make CopyOnWriteMap.Tree.getView method protected (was public).
bdad5a8 to
ea3b238
Compare
Contributor
|
Hi! I don't exactly know where Jenkins benefits from this optimization, but I've done some microbenchmarks around class RunMapTest {
// ...
@Test
void benchmark() throws Exception {
FreeStyleProject p = r.createFreeStyleProject();
RunMap<FreeStyleBuild> map = new RunMap<>(p);
// Populate the map
int count = 100_000;
for (int i = 0; i < count; i++) {
map.put(i, new FreeStyleBuild(p));
}
// Perform searches in both directions
Instant start = Instant.now();
for (int i = 0; i < count / 2; i++) {
if (i % 2 == 0) {
map.search(i, Direction.ASC);
} else {
map.search(count - i - 1, Direction.DESC);
}
}
Instant stop = Instant.now();
System.out.println("Benchmark took: " + Duration.between(start, stop).toMillis() + " ms");
}
}❯ mvn test -pl core,test -Dtest=RunMapTest#benchmark
|
jeromepochat
approved these changes
Aug 26, 2025
timja
approved these changes
Sep 1, 2025
Member
timja
left a comment
There was a problem hiding this comment.
Thanks!
/label ready-for-merge
This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.
Thanks!
Contributor
|
Not sure if this is the cause for JENKINS-76202 |
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.
See JENKINS-76028.
Optimise AbstractLazyLoadRunMap's search, firstKey, lastKey methods using NavigableMap features
Simplify wrapping with BuildReferenceMapAdapter by introducing single configuration class BuildReferenceMapAdapter.Resolver
Make CopyOnWriteMap.Tree.getView method protected (was public)
Testing done
Manual testing on a local setup, jenkins PR automation tests
Proposed changelog entries
Proposed changelog category
/label internal
Proposed upgrade guidelines
N/A
Submitter checklist
@Restrictedor have@since TODOJavadocs, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO"), if applicable.evalto ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
@jglick, @timja
Before the changes are marked as
ready-for-merge:Maintainer checklist
upgrade-guide-neededlabel is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidateto be considered (see query).