Created
September 29, 2010 20:05
-
-
Save melo/603436 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use warnings; | |
use lib 'lib'; | |
use Redis; | |
use Benchmark qw( cmpthese ); | |
my $r = Redis->new(encoding => undef); | |
my $v_100 = 'a' x 100; | |
my $v_1000 = 'a' x 1000; | |
my $v_10000 = 'a' x 10000; | |
my $v_100000 = 'a' x 100000; | |
cmpthese(-3, { | |
'set 100' => sub { $r->set('xx100', $v_100) }, | |
'get 100' => sub { $r->get('xx100') }, | |
'set 1000' => sub { $r->set('xx1000', $v_1000) }, | |
'get 1000' => sub { $r->get('xx1000') }, | |
'set 10000' => sub { $r->set('xx10000', $v_10000) }, | |
'get 10000' => sub { $r->get('xx10000') }, | |
'set 100000' => sub { $r->set('xx10000', $v_10000) }, | |
'get 100000' => sub { $r->get('xx10000') }, | |
}); | |
__DATA__ | |
Using http://github.com/gmaurice/perl-Redis/tree/redis2.0-test | |
Rate get 10000 get 100000 set 100000 set 10000 set 1000 get 1000 set 100 get 100 | |
get 10000 8692/s -- -2% -4% -4% -31% -34% -34% -37% | |
get 100000 8826/s 2% -- -2% -3% -30% -33% -33% -36% | |
set 100000 9019/s 4% 2% -- -1% -29% -32% -32% -35% | |
set 10000 9075/s 4% 3% 1% -- -28% -32% -32% -35% | |
set 1000 12637/s 45% 43% 40% 39% -- -5% -5% -9% | |
get 1000 13258/s 53% 50% 47% 46% 5% -- -0% -4% | |
set 100 13259/s 53% 50% 47% 46% 5% 0% -- -4% | |
get 100 13871/s 60% 57% 54% 53% 10% 5% 5% -- | |
Using http://github.com/melo/perl-Redis.git | |
Rate set 100000 set 10000 get 100000 get 10000 get 1000 get 100 set 1000 set 100 | |
set 100000 17117/s -- -2% -10% -10% -30% -32% -34% -37% | |
set 10000 17492/s 2% -- -8% -8% -29% -31% -33% -36% | |
get 100000 18974/s 11% 8% -- -1% -23% -25% -27% -30% | |
get 10000 19095/s 12% 9% 1% -- -22% -24% -27% -30% | |
get 1000 24607/s 44% 41% 30% 29% -- -2% -6% -9% | |
get 100 25200/s 47% 44% 33% 32% 2% -- -3% -7% | |
set 1000 26050/s 52% 49% 37% 36% 6% 3% -- -4% | |
set 100 27137/s 59% 55% 43% 42% 10% 8% 4% -- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment