From ac0aee7bc939601d0748a69126de4d1f9eb478eb Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 23 Mar 2009 14:45:32 +0000 Subject: [PATCH] benchmark bindings and redis server git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/Redis@52 447b33ff-793d-4489-8442-9bea7d161be5 --- scripts/redis-benchmark.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 scripts/redis-benchmark.pl diff --git a/scripts/redis-benchmark.pl b/scripts/redis-benchmark.pl new file mode 100755 index 0000000..e827817 --- /dev/null +++ b/scripts/redis-benchmark.pl @@ -0,0 +1,18 @@ +#!/usr/bin/perl + +use warnings; +use strict; +use Benchmark qw/:all/; +use lib 'lib'; +use Redis; + +my $r = Redis->new; + +timethese( 100000, { + 'ping' => sub { $r->ping }, + 'set' => sub { $r->set( 'bench-' . rand(), rand() ) }, + 'get' => sub { $r->get( 'bench-' . rand() ) }, + 'incr' => sub { $r->incr( 'bench-incr' ) }, + 'lpush' => sub { $r->lpush( 'bench-lpush', rand() ) }, + 'lpop' => sub { $r->lpop( 'bench-lpop' ) }, +}); -- 2.20.1