Perl client in C

harm harm at tty.nl
Thu Feb 2 15:22:29 UTC 2006


Hello,

to see how much CPU perl eats we've made another version of a memcache
client, this time in C.
It's faster but it currently does not support all the fancy features the pure perl
clients have (most notably no compression, no support for complex datatypes
and no stats(). See 'differences from Cache::Memcached' in the perldoc for
the full list.)
It does support namespaces and preserves UTF-8 flags.

The client runs fine here but can use a bit more testing. And maybe a better name.
http://dev.tty.nl/memcached/Cache-MemcacheC-1.1.tar.gz
(The 'C' is for 'Client'. Mostly.)

Thanks,
Harmen
Tty.nl


let's include some benchmarks this time. Below is the result of running against
a single localhost memcached, the pure perl version is the original 1.34.
CPU usage is 55% perl, 45% memcached when running the C version.


Benchmark: timing 100000 iterations of pp_get_m, pp_incr, pp_set, xs_get_m, xs_incr, xs_set...
  pp_get_m: 11.9979 wallclock secs ( 9.93 usr +  0.91 sys = 10.84 CPU) @ 9225.09/s (n=100000)
   pp_incr: 5.77204 wallclock secs ( 3.61 usr +  0.87 sys =  4.48 CPU) @ 22321.43/s (n=100000)
    pp_set: 5.6239 wallclock secs ( 3.54 usr +  0.84 sys =  4.38 CPU) @ 22831.05/s (n=100000)
  xs_get_m: 2.33475 wallclock secs ( 0.58 usr +  0.71 sys =  1.29 CPU) @ 77519.38/s (n=100000)
   xs_incr: 2.52283 wallclock secs ( 0.65 usr +  0.68 sys =  1.33 CPU) @ 75187.97/s (n=100000)
    xs_set: 2.51324 wallclock secs ( 0.58 usr +  0.72 sys =  1.30 CPU) @ 76923.08/s (n=100000)
-- 
                                The Moon is Waning Crescent (4% of Full)


More information about the memcached mailing list