Skip to content

Conversation

@tometzky
Copy link

Fixes:

Instead of removing elements from toRemove array while traversing it, which forces rewrite of the whole array each time, create a separate array toRemoveReally with elements that need to be removed.

Testing done

We're running our Jenkins instance on a patched version since March 2025. The instance has more than 10k jobs, almost all created with Groovy code by Jenkins DSL plugin. There was a dramatic drop of Jenkins CPU usage when the plugin was updated with with this change. We rebased the change several times since.

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

This is a performance change — it is not clear how to create a test case that demonstrates the change in a reasonable time.

@tometzky tometzky requested a review from a team as a code owner January 30, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant