-
Notifications
You must be signed in to change notification settings - Fork 992
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
TopologyComparators performance issue #1011
Labels
type: feature
A new feature
Milestone
Comments
Thanks for reporting the issue. Care to submit a pull request? |
mp911de
pushed a commit
that referenced
this issue
Apr 11, 2019
We now use BitSet.equals() to compare slot sets of RedisClusterNode for an improved comparison performance. Original pull request: #1013.
mp911de
pushed a commit
that referenced
this issue
Apr 11, 2019
We now use BitSet.equals() to compare slot sets of RedisClusterNode for an improved comparison performance. Original pull request: #1013.
Thanks a lot for your contribution! That's fixed now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Current Behavior
The
essentiallyEqualsTo
method of theTopologyComparators
has a performance issue due to the comparison between the slots. With an aggressive cluster topology refresh interval (500ms) and a single node cluster the machine spends the majority of the CPU on the theessentiallyEqualsTo
method and in specific on theo1.getSlots().containsAll(o2.getSlots())
code.Input Code
I created a this simple class to reproduce the error. In my machine this code takes around 11 seconds.
Expected behavior/code
The comparison should be faster so the cluster topology can be refreshed without impacting the performance of the application.
Environment
5.2.0.BUILD-SNAPSHOT
)Possible Solution
The
equals
method of theBitSet
should be equivalent so it can be used as alternative.This method can be part of the
RedisClusterNode
class.The test with the new method takes 20~ ms on my machine.
The text was updated successfully, but these errors were encountered: