-
Notifications
You must be signed in to change notification settings - Fork 23.9k
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
24bit integers for ziplists (patch) #469
Comments
I and Pieter like that... there is a code review effort in progress and it will probably enter 2.6. Thanks! More news soon. |
Note to self: if we add this we should make sure to change the RDB version as well for 2.6 / unstable. |
Code reviewed, it's broken ;) However it is not ok that the Redis test can't detect such a trivial corruption. However here the big problem is not that the patch is broken, it's trivial to fix, but that Redis tests were not able to check this trivial corruption. I'm adding a new test that can spot this errors easily. Cheers, |
I just added a test that can spot this issues trivially (unstable branch). |
Nice catch, obviously my specific case only used positive integers ;) There are two ways this can be solved. The simplest is to replace INT24_MIN with 0 and not bother storing two's complements in 24 bits? The other is some clever bitshifting to preserve that leftmost bit. |
@grisha what about this instead?
|
Yes, this is much clearer and works in my tests. I reworked my patch, if that's of any help: https://github.com/grisha/redis/commit/e3352e49ad9e410dd4e3979476df12738211802b Thanks! |
Thanks, I merged it and tried to go forward along the path of exploiting more bits, given that anyway we are going to update the RDB format. This is the result, including your patch: https://github.com/antirez/redis/compare/zipenc Cheers, |
Closing :) |
((unsigned char*)&i32)+1 is a bug!!!! if value is 0x00112233, in memory 33 22 11 00 |
This is a small patch to store integers that can fit in 24 bits using 3 bytes which makes ziplists even more memory efficient:
https://github.com/grisha/redis/tree/ziplist_24bit
https://github.com/grisha/redis/commit/2af8ebb25bb64bba385c495457a281b3298391a5
The text was updated successfully, but these errors were encountered: