/[Redis.pre-github]/scripts/redis-benchmark.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /scripts/redis-benchmark.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 55 by dpavlin, Mon Mar 23 14:45:32 2009 UTC revision 56 by dpavlin, Wed Mar 25 00:03:06 2009 UTC
# Line 8  use Redis; Line 8  use Redis;
8    
9  my $r = Redis->new;  my $r = Redis->new;
10    
11    my $i = 0;
12    
13  timethese( 100000, {  timethese( 100000, {
14          'ping'  => sub { $r->ping },          '00_ping'       => sub { $r->ping },
15          'set'   => sub { $r->set( 'bench-' . rand(), rand() ) },          '10_set'        => sub { $r->set( 'foo', $i++ ) },
16          'get'   => sub { $r->get( 'bench-' . rand() ) },          '11_set_r'      => sub { $r->set( 'bench-' . rand(), rand() ) },
17          'incr'  => sub { $r->incr( 'bench-incr' ) },          '20_get'        => sub { $r->get( 'foo' ) },
18          'lpush' => sub { $r->lpush( 'bench-lpush', rand() ) },          '21_get_r'      => sub { $r->get( 'bench-' . rand() ) },
19          'lpop'  => sub { $r->lpop( 'bench-lpop' ) },          '30_incr'       => sub { $r->incr( 'counter' ) },
20            '30_incr_r'     => sub { $r->incr( 'bench-' . rand() ) },
21            '40_lpush'      => sub { $r->lpush( 'mylist', 'bar' ) },
22            '40_lpush'      => sub { $r->lpush( 'mylist', 'bar' ) },
23            '50_lpop'       => sub { $r->lpop( 'mylist' ) },
24  });  });

Legend:
Removed from v.55  
changed lines
  Added in v.56

  ViewVC Help
Powered by ViewVC 1.1.26