Using memcached to cache subversion meta-data

christopher at christopher at
Thu Feb 3 21:27:53 PST 2005

> It's great to have a Python developer using Memcached... your next
project could be fixing up the Memcached python client.  :) Or at least
> sanity-checking the code for us.

I have to admit Python is a tertiary language for me.  I'm mainly a C++ hack.

> If I recall, the performance of it is pretty horrid... it does tons of
1-byte reads when reading responses from the server?  Evan was always
concerned about this:
>     def readline(self):
>         newlines = 0
>         buf = ''
>         while newlines < 2:
>             char = self.socket.recv(1) # XXX does this buffer or is this

I'd guess that wouldn't make much of a performance difference because the
OS will buffer the response packets.  There might be a minimal amount of
overhead from going in and out of kernel mode so frequently, but I doubt
it matters.  If it was a single byte write, then I'd finger it for a
performance problem.

I am working on another project where I intend to use both the python
client and the C client.  I will probably make some custom hacks to the
server as well.  I really need to be able to compare to sets of keys and
drop keys from the server that aren't in the second set.  There currently
isn't any way to do this as far as I can see.

Once I understand the protocol more, I might take a look at improving the
python client.

Christopher Baus

Implementing an HTTP proxy?
Consider a fast, secure alternative

More information about the memcached mailing list