Skip to content

Commit

Permalink
benchmark bindings and redis server
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.rot13.org/Redis@52 447b33ff-793d-4489-8442-9bea7d161be5
  • Loading branch information
dpavlin committed Mar 23, 2009
1 parent 217da37 commit 344d5b1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/redis-benchmark.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/perl

use warnings;
use strict;
use Benchmark qw/:all/;
use lib 'lib';
use Redis;

my $r = Redis->new;

timethese( 100000, {
'ping' => sub { $r->ping },
'set' => sub { $r->set( 'bench-' . rand(), rand() ) },
'get' => sub { $r->get( 'bench-' . rand() ) },
'incr' => sub { $r->incr( 'bench-incr' ) },
'lpush' => sub { $r->lpush( 'bench-lpush', rand() ) },
'lpop' => sub { $r->lpop( 'bench-lpop' ) },
});

0 comments on commit 344d5b1

Please sign in to comment.