Skip to content

Commit 06f57fd

Browse files
author
Ruben Bridgewater
committed
Add some more notes and tests
1 parent 352f8a5 commit 06f57fd

File tree

3 files changed

+71
-5
lines changed

3 files changed

+71
-5
lines changed

changelog.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Changelog
22
=========
33

4-
## v.2.2.0 - xx Oct, 2015 - The peregrino falcon
4+
## v.2.2.0 - 12 Oct, 2015 - The peregrino falcon
55

6-
The peregrino falcon is the fasted bird on earth and this is what this release is all about: We increased performance for heavy usage by up to **400%** [sic!] and increased overall performance for any command as well. Please check the benchmarks in the [README.md](README.md) for further details.
6+
The peregrino falcon is the fasted bird on earth and this is what this release is all about: Increased performance for heavy usage by up to **400%** [sic!] and increased overall performance for any command as well. Please check the benchmarks in the [README.md](README.md) for further details.
77

88
Features
99

@@ -18,15 +18,17 @@ Features
1818

1919
Bugfixes
2020

21-
- Fix a javascript parser regression introduced in 2.0 that could result in timeouts on high load. ([@BridgeAR](https://github.com/BridgeAR))
21+
- Fix a javascript parser regression introduced in 2.0 that could result in timeouts on high load. <b>*</b> ([@BridgeAR](https://github.com/BridgeAR))
2222
- Fixed should_buffer boolean for .exec, .select and .auth commands not being returned and fix a couple special conditions ([@BridgeAR](https://github.com/BridgeAR))
2323

24+
* I was not able to write a regression test for this, since the error seems to only occur under heavy load with special conditions. So please have a look for timeouts with the js parser, if you use it and report all issues and switch to the hiredis parser in the meanwhile. If you're able to come up with a reproducable test case, this would be even better :)
25+
2426
If you do not rely on transactions but want to reduce the RTT you can use .batch from now on. It'll behave just the same as .multi but it does not have any transaction and therefor won't roll back any failed commands.<br>
2527
Both .multi and .batch are from now on going to cache the commands and release them while calling .exec.
2628

2729
Please consider using .batch instead of looping through a lot of commands one by one. This will significantly improve your performance.
2830

29-
Here are some stats compared to ioredis 1.9.1:
31+
Here are some stats compared to ioredis 1.9.1 (Lenovo T450s i7-5600U):
3032

3133
simple set
3234
82,496 op/s » ioredis
@@ -38,7 +40,7 @@ Here are some stats compared to ioredis 1.9.1:
3840

3941
simple get with pipeline
4042
10,233 op/s » ioredis
41-
26,541 op/s » node_redis
43+
26,541 op/s » node_redis (using .batch)
4244

4345
lrange 100
4446
7,321 op/s » ioredis
@@ -54,6 +56,10 @@ Here are some stats compared to ioredis 1.9.1:
5456

5557
To conclude: we can proudly say that node_redis is very likely outperforming any other node redis client.
5658

59+
Known issues
60+
61+
- The pub sub system has some flaws and those will be addressed in the next minor release
62+
5763
## v2.1.0 - Oct 02, 2015
5864

5965
Features:

test/batch.spec.js

+15
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ describe("The 'batch' method", function () {
6363
client.end();
6464
});
6565

66+
it("returns an empty array", function (done) {
67+
var batch = client.batch();
68+
batch.exec(function (err, res) {
69+
assert.strictEqual(err, null);
70+
assert.strictEqual(res.length, 0);
71+
done();
72+
});
73+
});
74+
75+
it("returns an empty array if promisified", function () {
76+
return client.batch().execAsync().then(function(res) {
77+
assert.strictEqual(res.length, 0);
78+
});
79+
});
80+
6681
it("returns an empty result array", function (done) {
6782
var batch = client.batch();
6883
var async = true;

test/pubsub.spec.js

+45
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,51 @@ describe("publish/subscribe", function () {
285285
});
286286
});
287287

288+
// TODO: Fix pub sub
289+
// And there's more than just those two issues
290+
describe.skip('FIXME: broken pub sub', function () {
291+
292+
it("should not publish a message without any publish command", function (done) {
293+
pub.set('foo', 'message');
294+
pub.set('bar', 'hello');
295+
pub.mget('foo', 'bar');
296+
pub.subscribe('channel');
297+
pub.on('message', function (msg) {
298+
done(new Error('This message should not have been published: ' + msg));
299+
});
300+
setTimeout(done, 500);
301+
});
302+
303+
it("should not publish a message multiple times per command", function (done) {
304+
var published = {};
305+
306+
function subscribe(message) {
307+
sub.on('subscribe', function () {
308+
pub.publish('/foo', message);
309+
});
310+
sub.on('message', function (channel, message) {
311+
if (published[message]) {
312+
done(new Error('Message published more than once.'));
313+
}
314+
published[message] = true;
315+
});
316+
sub.on('unsubscribe', function (channel, count) {
317+
assert.strictEqual(count, 0);
318+
});
319+
sub.subscribe('/foo');
320+
}
321+
322+
subscribe('hello');
323+
324+
setTimeout(function () {
325+
sub.unsubscribe();
326+
setTimeout(function () {
327+
subscribe('world');
328+
}, 400);
329+
}, 400);
330+
});
331+
});
332+
288333
afterEach(function () {
289334
sub.end();
290335
pub.end();

0 commit comments

Comments
 (0)