php, python, perl, again.

Brian Moon brianm at dealnews.com
Fri Jun 30 17:28:31 UTC 2006


Perrin Harkins wrote:
> Here are a couple of patches that should improve the performance of the
> Perl version of Small.pm and SetGets.pm.  These have nothing to do with
> memcached, but fix some slow things in the testing code.  The principles
> here (slurp files, avoid C-style for loops) apply more generally to all
> the rest, but I didn't bother to do all of them.

Thanks, those do help a little.  1 more req/s for GetsSets and about 10 
more for the small file read.

> Note that you should never read a large file into memory in one go, like
> you're doing in Large.pm.  That will chew up too much RAM.  You should
> either let apache handle the file or chunk it yourself with repeated
> reads and writes.

The point of that test was to simulate the memcached call using a file 
on disk.  I would never do it that way in the real world.  In PHP I 
would use readfile() to do the job.  Using readfile(), the PHP script 
tests at 100 more req/s.  But, I was trying to create scenarios that 
were as similar as possible to reading the key from memcached.  You 
can't really chunk that unless you break up the cache to start with.

-- 

Brian Moon
-------------
http://dealnews.com/
Its good to be cheap =)


More information about the memcached mailing list