X-Git-Url: http://git.rot13.org/?p=perl-Redis.git;a=blobdiff_plain;f=scripts%2Fredis-benchmark.pl;h=05fcdad79c9cdcb0840d01461db73f4a76863542;hp=74759b06f2e2fc502749ce6743a8cbc497a36e8b;hb=5bd01e43067423a62065bb664e170324fbe1ddd5;hpb=eee28c05a37edb8220fc9ab7828a73ff014bc77d diff --git a/scripts/redis-benchmark.pl b/scripts/redis-benchmark.pl index 74759b0..05fcdad 100755 --- a/scripts/redis-benchmark.pl +++ b/scripts/redis-benchmark.pl @@ -5,9 +5,13 @@ use strict; use Benchmark qw/:all/; use lib 'lib'; use Redis; +use Redis::Hash; my $r = Redis->new; +my %hash; +tie %hash, 'Redis::Hash', 'hash'; + my $i = 0; timethese( 100000, { @@ -21,4 +25,6 @@ timethese( 100000, { '40_lpush' => sub { $r->lpush( 'mylist', 'bar' ) }, '40_lpush' => sub { $r->lpush( 'mylist', 'bar' ) }, '50_lpop' => sub { $r->lpop( 'mylist' ) }, + '90_h_set' => sub { $hash{ 'test' . rand() } = rand() }, + '90_h_get' => sub { my $a = $hash{ 'test' . rand() }; }, });