Minor libmemcache issue inside php extension

John McCaskey johnm at klir.com
Tue Jan 18 09:43:41 PST 2005


Early performance tests of 50000 single get commands:

Antony's PECL Extension: 1.650 seconds (average of multiple test
libmemcache wrapper Extension: 1.439 seconds (again average of multiple

I'll do further benchmarks with multi-gets and other various commands
when I finish up the remaining work.

On Tue, 2005-01-18 at 09:25 -0800, John McCaskey wrote:
> Sean,
> I worked on a php extension wrapper for libmemcache over the weekend and
> made good progress.  Currently get, set, replace, add, stats, and
> add_server are all working. I still need to implement multi-gets, and I
> need to consider whether the callback mechanism makes sense to implement
> in php, as well as whether trying to implement persistent memcache()
> objects makes sense for the initial release.
> I did run into one minor issue, it seems that the %hu and %zu format
> strings do not work.  I can only assume php is overriding my systems
> snprintf as they always work outside of the php extension.  What is
> happening is that they don't fail gracefully either, and they just
> output SET key %zu 0 %hu or whatever to the server, which obviously
> fails.
> As such I'm currently working with having patched the
> mcm_storage_command to just use %u in place of %hu and %zu.  
> Maybe for portability it should just be changed to that?
> I plan to clean up my php extension work and finish up the remaining
> methods tonight.  Hopefully I'll post up an initial release by tommorow
> morning.
John A. McCaskey
Software Development Engineer
Klir Technologies, Inc.
johnm at klir.com

More information about the memcached mailing list