Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of relative path mapping #292

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

GoodOwl
Copy link
Contributor

@GoodOwl GoodOwl commented Dec 10, 2024

Process the file nodes using a single pass

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 demonstrates feature works or fixes the issue

.forEach(file -> file.setRelativePath(builder.intern(pathMapping.get(file.getRelativePath()))));
rootNode.getAllFileNodes().forEach(file -> {
String newPath = pathMapping.get(file.getRelativePath());
if (newPath != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please avoid using null in the code base? It makes more sense to use containsKey as guard.

Copy link
Member

@uhafner uhafner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise it looks good! We can ignore the PIT error, they changed the internal format again...

It would be also helpful if you can describe the change in the commit message by rewriting the commit.

@uhafner uhafner added the bug Bugs or performance problems label Dec 10, 2024
@uhafner uhafner changed the title Update CoverageRecorder.java Improve performance of relative path mapping Dec 10, 2024
@GoodOwl GoodOwl force-pushed the faster-path-resolver branch from cfdacfd to ba75ea4 Compare December 11, 2024 08:29
Copy link
Member

@uhafner uhafner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@uhafner uhafner merged commit 0949826 into jenkinsci:main Dec 11, 2024
28 of 29 checks passed
@GoodOwl GoodOwl deleted the faster-path-resolver branch December 11, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs or performance problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants