/[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 59 by dpavlin, Wed Mar 25 00:03:06 2009 UTC revision 60 by dpavlin, Sun Jul 26 01:33:13 2009 UTC
# Line 5  use strict; Line 5  use strict;
5  use Benchmark qw/:all/;  use Benchmark qw/:all/;
6  use lib 'lib';  use lib 'lib';
7  use Redis;  use Redis;
8    use Redis::Hash;
9    
10  my $r = Redis->new;  my $r = Redis->new;
11    
12    my %hash;
13    tie %hash, 'Redis::Hash', 'hash';
14    
15  my $i = 0;  my $i = 0;
16    
17  timethese( 100000, {  timethese( 100000, {
# Line 21  timethese( 100000, { Line 25  timethese( 100000, {
25          '40_lpush'      => sub { $r->lpush( 'mylist', 'bar' ) },          '40_lpush'      => sub { $r->lpush( 'mylist', 'bar' ) },
26          '40_lpush'      => sub { $r->lpush( 'mylist', 'bar' ) },          '40_lpush'      => sub { $r->lpush( 'mylist', 'bar' ) },
27          '50_lpop'       => sub { $r->lpop( 'mylist' ) },          '50_lpop'       => sub { $r->lpop( 'mylist' ) },
28            '90_h_set' => sub { $hash{ 'test' . rand() } = rand() },
29            '90_h_get' => sub { my $a = $hash{ 'test' . rand() }; },
30  });  });

Legend:
Removed from v.59  
changed lines
  Added in v.60

  ViewVC Help
Powered by ViewVC 1.1.26