Skip to content

Reduce number of calls to FlowNode#getEnclosingId#883

Merged
timja merged 1 commit intojenkinsci:mainfrom
lewisbirks:reduce-computations
Jul 8, 2025
Merged

Reduce number of calls to FlowNode#getEnclosingId#883
timja merged 1 commit intojenkinsci:mainfrom
lewisbirks:reduce-computations

Conversation

@lewisbirks
Copy link
Contributor

@lewisbirks lewisbirks commented Jul 8, 2025

A continuation of the investigation for #862, FlowNode#getEnclosingId was being called multiple times in NodeRelationshipFinder#addSeenNodes. Whilst the majority of the calculations were cached on the initial call, subsequent looks would still have to acquire locks and checks as it performs the non cached operations. Therefore reduce it to just once.

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

Signed-off-by: Lewis Birks <22620804+lewisbirks@users.noreply.github.com>
@lewisbirks lewisbirks requested a review from a team as a code owner July 8, 2025 15:27
@timja timja added the bug Something isn't working label Jul 8, 2025
@timja timja enabled auto-merge (squash) July 8, 2025 15:31
@timja timja merged commit 55503fe into jenkinsci:main Jul 8, 2025
16 of 17 checks passed
@lewisbirks lewisbirks deleted the reduce-computations branch July 8, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants