Possible improvement to the slab allocator...

Tony Di Croce dicroce at gmail.com
Thu Aug 23 21:17:00 UTC 2007

I think you could gain a little speed in your slab allocator by re-writing
slabs_clsid() to use a lookup table.

Basically, if you had an array with 1mb buckets, where each bucket was a
pointer (so that the total size of the array would be 4mb), you could locate
which slab to use simply by using the requested size as an index... It would
save walking that array of up to POWER_LARGEST buckets.

Since this function is called by do_slab_alloc(), it could potentially be a
big win.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20070823/647ebe87/attachment.htm

More information about the memcached mailing list