Skip to content

Commit

Permalink
Remove warning about missing hiredis. You probably do want it though.
Browse files Browse the repository at this point in the history
  • Loading branch information
mranney committed Dec 9, 2010
1 parent e0ff3fe commit cfe0df1
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ official `hiredis` C library, which is non-blocking and fast. To use `hiredis`,

If `hiredis` is installed, `node_redis` will use it by default.

## Why?

## Why so many Redis clients for node?

`node_redis` works in the latest versions of node, is published in `npm`, is used by many people, and is in production on a
number of sites.
Expand All @@ -23,6 +24,33 @@ number of sites.
with recent versions of node.


## Performance

Here are typical results of `multi_bench.js` which is similar to `redis-benchmark` from the Redis distribution.
It uses 50 concurrent connections with no pipelining.

JavaScript parser:

PING: 20000 ops 42283.30 ops/sec 0/5/1.182
SET: 20000 ops 32948.93 ops/sec 1/7/1.515
GET: 20000 ops 28694.40 ops/sec 0/9/1.740
INCR: 20000 ops 39370.08 ops/sec 0/8/1.269
LPUSH: 20000 ops 36429.87 ops/sec 0/8/1.370
LRANGE (10 elements): 20000 ops 9891.20 ops/sec 1/9/5.048
LRANGE (100 elements): 20000 ops 1384.56 ops/sec 10/91/36.072

hiredis parser:

PING: 20000 ops 46189.38 ops/sec 1/4/1.082
SET: 20000 ops 41237.11 ops/sec 0/6/1.210
GET: 20000 ops 39682.54 ops/sec 1/7/1.257
INCR: 20000 ops 40080.16 ops/sec 0/8/1.242
LPUSH: 20000 ops 41152.26 ops/sec 0/3/1.212
LRANGE (10 elements): 20000 ops 36563.07 ops/sec 1/8/1.363
LRANGE (100 elements): 20000 ops 21834.06 ops/sec 0/9/2.287

The performance of `node_redis` improves dramatically with pipelining.

## Usage

Simple example, included as `example.js`:
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

## v0.4.1 - December 8, 2010

Remove warning about missing hiredis. You probably do want it though.

## v0.4.0 - December 5, 2010

Support for multiple response parsers and hiredis C library from Pieter Noordhuis.
Expand Down
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,21 @@ var net = require("net"),
default_port = 6379,
default_host = "127.0.0.1";

// can set this to true to enable for all connections
exports.debug_mode = false;

// hiredis might not be installed
try {
require("./lib/parser/hiredis");
parsers.push(require("./lib/parser/hiredis"));
} catch (err) {
console.log("hiredis parser not installed.");
if (exports.debug_mode) {
console.log("hiredis parser not installed.");
}
}

parsers.push(require("./lib/parser/javascript"));

// can set this to true to enable for all connections
exports.debug_mode = false;

function to_array(args) {
var len = args.length,
arr = new Array(len), i;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ "name" : "redis",
"version" : "0.4.0",
"version" : "0.4.1",
"description" : "Redis client library",
"author": "Matt Ranney <[email protected]>",
"contributors": [
Expand Down

0 comments on commit cfe0df1

Please sign in to comment.