Reduce number of calculations when finding a nodes relationships#882
Merged
timja merged 7 commits intojenkinsci:mainfrom Jul 8, 2025
Merged
Reduce number of calculations when finding a nodes relationships#882timja merged 7 commits intojenkinsci:mainfrom
timja merged 7 commits intojenkinsci:mainfrom
Conversation
Signed-off-by: Lewis Birks <22620804+lewisbirks@users.noreply.github.com>
Signed-off-by: Lewis Birks <22620804+lewisbirks@users.noreply.github.com>
…f a linked hash map? Signed-off-by: Lewis Birks <22620804+lewisbirks@users.noreply.github.com>
… are then sorted, as such just use a collection/list Signed-off-by: Lewis Birks <22620804+lewisbirks@users.noreply.github.com>
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.
Whilst investigating performance issues of #862 it was noticed that
node.getEnclosingBlocks()was being called twice inNodeRelationshipFinder#getFirstEnclosingNode. Whilst some of the computation of this result was cached, not all of it was which means there is extra work being done that isn't required.I also noticed that some maps were being passed around that might have once been used as a lookup table but now were only being used to access values.
Some other small cleanup has been done where newer java functionality is available or the code could be simplified.
Testing done
Submitter checklist