-
Notifications
You must be signed in to change notification settings - Fork 153
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
[Improvement] Use OR operation instead of serialization for cloning BitMaps #103
Conversation
Codecov Report
@@ Coverage Diff @@
## master #103 +/- ##
============================================
+ Coverage 56.33% 56.34% +0.01%
Complexity 1176 1176
============================================
Files 149 149
Lines 7992 7987 -5
Branches 766 766
============================================
- Hits 4502 4500 -2
+ Misses 3246 3242 -4
- Partials 244 245 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. |
Could we have a simple benchmark test? |
Performance is not the main concern here. If you find this change is impacting performance later, try {
return deserializeBitMap(serializeBitMap(bitmap));
} catch(IOException e) {
// not expected
} Just look at the body of And explicitly throwing RuntimeException is not a good practice, |
Sadly, we care the performance here. We need performance test to ensure that the pr won't bring worse performance. Bitmap method |
Great work! |
Could you use some random number to test them again? Because bitmap will compress the ordered number, the size of bitmap will be smaller, we test in more situations, the result will be more persuasive. |
Removed this test because it might be flaky due to resource sharing in the CI environment. |
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.
LGTM, thanks for your contribution @kaijchen.
Thanks @jerqi for the review. |
What changes were proposed in this pull request?
RssUtils#cloneBitMap()
.deserializeBitMap(serializeBitMap(bitmap))
bycloneBitMap(bitmap)
.Why are the changes needed?
IOException
.Does this PR introduce any user-facing change?
No.
How was this patch tested?
New unit test
RssUtilsTest#testCloneBitmap()