[Improvement] Use OR operation instead of serialization for cloning BitMaps#103
Conversation
|
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. |




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()