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

[JENKINS-55804] - Attempt to solve issue #53

Merged
merged 13 commits into from
Jan 28, 2019

Conversation

deepanshnagaria
Copy link
Contributor

my attempt to fix the issue(55804,Performance: Reduce memory footprint and execution time for RoleMap#newMatchingRoleMap() )by removing the intermediate collections in the method newMatchingRoleMap(), which were created on call of getMatchingRoles() fuction.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Would be also nice to remove the original private method if it is no longer used

@@ -60,6 +44,14 @@
import org.kohsuke.stapler.DataBoundConstructor;
import org.springframework.dao.DataAccessException;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import java.util.*;
Copy link
Member

Choose a reason for hiding this comment

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

Better to avoid wildcard imports. Sometimes it causes ambiguuty conflicts

@deepanshnagaria
Copy link
Contributor Author

@oleg-nenashev thanks for the response. I was myself going to ask if that method is to be kept or not..... , removed the wildcard, any other changes you would like?

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

LGTM except one minor comment

roleMap.put(role, this.grantedRoles.get(role));
}
new RoleWalker()
{
Copy link
Member

Choose a reason for hiding this comment

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

NIT: codestyle. In Java opening bracket usually goes to the initiating closure, e.g. new RoleWalker() {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh i didn't notice that, thanks for pointing. Did the changes, if any further changes are required do point out. Thanks. @oleg-nenashev

new RoleWalker() {
public void perform(Role current) {
Matcher m = current.getPattern().matcher(namePattern);
if (m.matches()) {
Copy link
Member

Choose a reason for hiding this comment

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

Minor thing: indenting is broken here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for those repeated formatting issues. I have changed that, will try to overcome this next time on wards.

@oleg-nenashev
Copy link
Member

@deepanshnagaria nothing is really needed here apart from the formatting fix. I will mere the PR after it

@oleg-nenashev
Copy link
Member

Thanks @deepanshnagaria !

@oleg-nenashev oleg-nenashev merged commit 529512e into jenkinsci:master Jan 28, 2019
@oleg-nenashev
Copy link
Member

Uh, I finally didn't squash it :(
Anyway, it is not a big traffic in the plugin nowadays

@deepanshnagaria
Copy link
Contributor Author

deepanshnagaria commented Jan 28, 2019

@oleg-nenashev i wanted to ask if the implementation i did is what also solves https://issues.jenkins-ci.org/browse/JENKINS-55807 ? Actually i didn't understand the issue clearly ,but feel that it says something similar.. Should I add that issue too in the heading?? @runzexia

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.

2 participants