« Swifty-0.02 and Perl Binding | Main | Swifty 0.05 and the Thundering Herd »

Swifty 0.03

This is the release announcement of swifty version 0.03 and its perl binding Cache-Swifty 0.03.

To install swifty, run configure, make, and make install. To install Cache-Swifty, run perl Makefile.PL, make, and make install. Changes from the previous version are:

  1. change cache model from direct map to n-way set associative (max. of n is 64)
  2. bug fixes
  3. optimizations in perl binding

Below are the performance numbers on an Opteron server running CentOS 5. The left column lists the cache modules used. Swifty_direct shows the numbers when directly calling the XS interface of Swifty. Hash is a OO-style wrapper for perl's ordinally hash. Interesting points are:

  • Cache::FastMmap is comparatively faster than on a Mac OS X
  • on reads, swifty_direct is only from 19% to 28% slower than perl's ordinally hash
I wonder if someone could rewrite all of the Cache::Swifty interface in C, so that we can see a similar performance when using swifty with an OO interface.

$ perl -Iblib/lib -Iblib/arch -Ilib benchmark/all.pl 500 hash Cache::FastMmap Cache::Swifty swifty_direct

Write (16 bytes):
                  Rate Cache::FastMmap Cache::Swifty swifty_direct          hash
Cache::FastMmap 13.1/s              --          -90%          -94%          -97%
Cache::Swifty    133/s            919%            --          -40%          -74%
swifty_direct    223/s           1605%           67%            --          -56%
hash             510/s           3798%          283%          129%            --

Read  (16 bytes):
                  Rate Cache::FastMmap Cache::Swifty swifty_direct          hash
Cache::FastMmap 41.6/s              --          -80%          -91%          -93%
Cache::Swifty    205/s            392%            --          -57%          -65%
swifty_direct    476/s           1044%          132%            --          -19%
hash             588/s           1313%          187%           24%            --

Write (1024 bytes):
                  Rate Cache::FastMmap Cache::Swifty swifty_direct          hash
Cache::FastMmap 12.6/s              --          -90%          -94%          -97%
Cache::Swifty    125/s            893%            --          -39%          -70%
swifty_direct    207/s           1541%           65%            --          -50%
hash             413/s           3183%          231%          100%            --

Read  (1024 bytes):
                  Rate Cache::FastMmap Cache::Swifty swifty_direct          hash
Cache::FastMmap 38.6/s              --          -79%          -91%          -93%
Cache::Swifty    183/s            375%            --          -56%          -68%
swifty_direct    413/s            972%          126%            --          -28%
hash             575/s           1391%          214%           39%            --

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)