-
Notifications
You must be signed in to change notification settings - Fork 824
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
Fix: Fixing performance while calling containsAll over list #2272
Conversation
|
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/184880763 The labels on this github issue will be updated when the story is started. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok for me
@Tallicia @bruce-ricard any concerns |
The 8 test look good and the optimization does as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement.
Would be nice to see performance tests to see if sets are of large enough size in practice to know the real world performance improvement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making performance improvements.
To be perfectly frank, I am not convinced that this change will improve performance in the general practical world. I don't know if most objects don't have one or two roles. And this change forces the creation of 2 new hashsets every single time.
Also, we cannot find any usage of that equals
method in the UAA code base. I don't think that this change will have any impact at all.
Additionally, I am not convinced that Java doesn't already use HashSets internally to resolve containsAll
calls on List
object.
@Tallicia and me
server/src/main/java/org/cloudfoundry/identity/uaa/user/UserInfo.java
Outdated
Show resolved
Hide resolved
I have tested this and created an extra PR #2294 Finally, I will merge this, so thanks for your PR |
Improving performance in case of
by using
HashSet
wrapper around one of the listsThis improves time complexity.