Skip to content

Instantly share code, notes, and snippets.

@yappo
Created September 4, 2009 07:15
Show Gist options
  • Select an option

  • Save yappo/180780 to your computer and use it in GitHub Desktop.

Select an option

Save yappo/180780 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Benchmark ':all';
use LWP::Simple;
use Cache::Memcached::Fast;
my $mc = Cache::Memcached::Fast->new({ servers => [ 'localhost:12321' ] });
cmpthese(10000, {
http => sub {
die unless (get 'http://localhost:8080/yappo') eq 'yappo';
},
memcached => sub {
die unless ($mc->get('/yappo') eq 'yappo');
},
});
__END__
Rate http memcached
http 2433/s -- -33%
memcached 3623/s 49% --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment