attached a patch which uses only the multi-bulk protocol for
communication with redis (and therefor supports all commands).
My bulk tests showed no measurable slowdown.
Cheers,
Dirk
ps: nice project!
Hello Dirk,
thanks, probably in the future the way to go is to support only the
new protocol and drop the old one at all.
This has a number of good effects, including for instance the removal
of many lines of code from Redis.c parsing code, the support for
binary keys, and client libs that are mostly ready for any kind of new
command without any effort.
Cheers,
Salvatore
--
Salvatore 'antirez' Sanfilippo
http://invece.org
"Once you have something that grows faster than education grows,
you’re always going to get a pop culture.", Alan Kay
> thanks, probably in the future the way to go is to support only the
> new protocol and drop the old one at all.
Actually there is a minor difference:
PING: 32518.34 requests per second
PING (multi bulk): 30751.66 requests per second
(this test is against 1,000,000 requests), but the current
implementation ok multi bulk is not as fast as it could be, as my goal
was to make the code not too much complex so I did a trick to use the
old code to parse a bulk reply in order to parse every argument of the
multi bulk reply.
Probably once I fix this problem both protocols should perform the same.
It's more work after all.
Using Redis.pm to insert roughly 1m keys + approx. 4m set and ordered
set (very useful btw.) values didn't show any difference in runtime:
approx. 20min runtime for a day of logprocessing for both versions.
Btw.: one useful feature could be to support serverside key prefixes
for a session, e.g.:
KEYPREFIX my.reports.2010-02-01.
the next
SET key value
or
INCR key
would create or increase a key named 'my.reports.2010-02-01.key'.
When doing bulk key creations this would save some bandwith maybe.
But then maybe im just doing it wrong, i use something like 'KEYS *.
2010-02-1.*.distinct_matches' a lot to fetch the values im interested
in....
Cheers,
Dirk
Gleicon, from what I read, the Redis Power is with you :)
Sorted sets, Sets and Lists, are very useful even to build indexes
indeed. It's just a matter of finding the best data types and
organization to obtain the best results. KEYS is an O(N) operation
that should only be used for maintenance operations, like scripts to
modify the DB schema, debugging, and so forth.
Could you explain what you mean exactly? Do you duplicate all keys
into a SET and query this set then? Using SORT ... GET?
I don't see why the query for the candidate keys should be faster than
KEYS (the key namespace is a set after all). I do understand that you
get the "values" of your search result without doing a further client-
server roundtrip (sending the MGET for the keys), which will speed up
the whole query, but the search performance should be comparable
right?
Cheers,
Dirk