Redis weekly update #2 - Real world hashes, refactoring, and fixes Monday, 22 March 10

Hello, welcome to the weekly update #2, this time it shifted to Monday as I used the whole Friday for debugging purposes as you'll read in a minute. So this is what happened in the last week, more or less in chronological order.

Real world hashes

Hashes were just a shy start the last week, now they are much better: There are even a couple of users trying hashes in pre-production stage!

Redis-rb hashes and a few other fixes

I find some time in order to hack a bit with Redis-rb and sent a pull request to Ezra that promptly merged the changes. This is what is now fixed:

Refactoring and other improvements

I did a pretty big refactoring of redis.c, basically many commands started nesting with a couple of ifs in order to test if the key was actually found, reply with the right object if it was not, checking the type of the object after the lookup and so forth. Pretty lame, now there are helper functions to do this in a much more interesting way.

Also now the method to compare two Redis objects in hash table lookups is optimized in order to exploit the fact that two objects that are both REDIS_ENCODING_INT can be compared for the o->ptr field directly (as the pointer is instead a long representing the object integer value, casted to a void*). This leads to a major speedups in some Set and Sorted Set operation.

Debugging

Contributions

The trend continues, even this week I received interesting patches:

Thanks guys!

Linenoise

Redis-cli needed line editing support. Redis is zero-configuration and I always wondered why there wasn't a simple self-contained, BSD licensed, line editing library now that everybody is using an xterm-capable terminal. Linenoise is the result and just took 2 hours of my weekend. It will be included in Redis in a few days in order to provide out of the box line editing support. I'll try to support a few more Emacs-alike bindings in the future to make it a bit more usable, but I think it's already pretty decent.

See you the next week with the weekly update.

10 comments
home