-
Notifications
You must be signed in to change notification settings - Fork 472
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
Support BITOP command #471
Conversation
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.
cool, thanks for your hard work! @ColinChamber
This implementation may cause performance issue when the bitmap was sparsely, but it's more clear and simple than using the seek operator. So it looks good to me. HDYT @ShooterIT
|
I think so. |
@ColinChamber Yeah, the key order was easy to change, what i think was to seek out all fragments and apply the operator on those fragments without depending on the key order. |
Do you mean |
@ColinChamber RocksDB write batch would also cache those fragments on memory before writing indeed, so it should be not different. |
That is the memory consumed by destkey.
|
Yeah, we can apply those fragments one by one, so the number of memory was same as current solution. |
It will depend on the subkey order. If we want to seek, then iterate one by one. |
Sorry that I didn't explain clearly. What I mean was below:
|
Sorry for my late understanding. Your method will improve performance, but the number of calculations will increase. I think the best way is to iterate and calculate all srckeys simultaneously, which relies on getting subkeys in index order. Getting subkeys in index order can also improve the performance of bitcount. What is the reason we don't do that? Is it to maintain compatibility with the previous version? |
For why we didn't use seek operator at bitcount command, it's a design mistake because we only focus on hot commands like getbit and setbit, and didn't carefully design the key format before implementing the bitcount. A compatible way is to use the extra bits to flag the new key format, but it's too tricky which I don't think we should do it now. So current implementation was good to me and can refactor it if those commands performance issue was the key point for us. |
0dcfdbf
to
e846fb5
Compare
I have no advice on this PR. @ShooterIT @ChrisZMF |
LGTM @ShooterIT |
No description provided.