projects
/
perl-Redis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f297ca
)
added Redis::Hash benchmarks
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 26 Jul 2009 01:33:13 +0000
(
01:33
+0000)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 26 Jul 2009 01:33:13 +0000
(
01:33
+0000)
git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/Redis@60
447b33ff
-793d-4489-8442-
9bea7d161be5
scripts/redis-benchmark.pl
patch
|
blob
|
history
diff --git
a/scripts/redis-benchmark.pl
b/scripts/redis-benchmark.pl
index
74759b0
..
05fcdad
100755
(executable)
--- 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() }; },
});