Parent Directory | Revision Log
benchmark bindings and redis server
1 | dpavlin | 52 | #!/usr/bin/perl |
2 | |||
3 | use warnings; | ||
4 | use strict; | ||
5 | use Benchmark qw/:all/; | ||
6 | use lib 'lib'; | ||
7 | use Redis; | ||
8 | |||
9 | my $r = Redis->new; | ||
10 | |||
11 | timethese( 100000, { | ||
12 | 'ping' => sub { $r->ping }, | ||
13 | 'set' => sub { $r->set( 'bench-' . rand(), rand() ) }, | ||
14 | 'get' => sub { $r->get( 'bench-' . rand() ) }, | ||
15 | 'incr' => sub { $r->incr( 'bench-incr' ) }, | ||
16 | 'lpush' => sub { $r->lpush( 'bench-lpush', rand() ) }, | ||
17 | 'lpop' => sub { $r->lpop( 'bench-lpop' ) }, | ||
18 | }); |
Name | Value |
---|---|
svn:executable | * |
ViewVC Help | |
Powered by ViewVC 1.1.26 |