|
4 | 4 |
|
5 | 5 | # redis-parser
|
6 | 6 |
|
7 |
| -A high performance redis parser solution built for [node_redis](https://github.com/NodeRedis/node_redis) and [ioredis](https://github.com/ioredis/luin). |
| 7 | +A high performance redis parser solution built for [node_redis](https://github.com/NodeRedis/node_redis) and [ioredis](https://github.com/luin/ioredis). |
8 | 8 |
|
9 | 9 | Generally all [RESP](http://redis.io/topics/protocol) data will be properly parsed by the parser.
|
10 | 10 |
|
@@ -95,31 +95,22 @@ var parser = new Parser({
|
95 | 95 | The [hiredis](https://github.com/redis/hiredis) parser is still the fasted parser for
|
96 | 96 | Node.js and therefor used as default in redis-parser if the hiredis parser is available.
|
97 | 97 |
|
98 |
| -Otherwise the pure js NodeRedis parser is choosen that is almost as fast as the |
| 98 | +Otherwise the pure js NodeRedis parser is chosen that is almost as fast as the |
99 | 99 | hiredis parser besides some situations in which it'll be a bit slower.
|
100 | 100 |
|
101 | 101 | ## Protocol errors
|
102 | 102 |
|
103 |
| -To handle protocol errors (this is very unlikely to happen) gracefuly you should add the returnFatalError option, reject any still running command (they might have been processed properly but the reply is just wrong), destroy the socket and reconnect. |
| 103 | +To handle protocol errors (this is very unlikely to happen) gracefully you should add the returnFatalError option, reject any still running command (they might have been processed properly but the reply is just wrong), destroy the socket and reconnect. |
104 | 104 | Otherwise a chunk might still contain partial data of a following command that was already processed properly but answered in the same chunk as the command that resulted in the protocol error.
|
105 | 105 |
|
106 | 106 | ## Contribute
|
107 | 107 |
|
108 | 108 | The js parser is already optimized but there are likely further optimizations possible.
|
109 |
| -Besides running the tests you'll also have to run the change at least against the node_redis benchmark suite and post the improvement in the PR. |
110 |
| -If you want to write a own parser benchmark, that would also be great! |
111 | 109 |
|
112 | 110 | ```
|
113 | 111 | npm install
|
114 | 112 | npm test
|
115 |
| -
|
116 |
| -# Run node_redis benchmark (let's guess you cloned node_redis in another folder) |
117 |
| -cd ../redis |
118 |
| -npm install |
119 |
| -npm run benchmark parser=javascript > old.log |
120 |
| -# Replace the changed parser in the node_modules |
121 |
| -npm run benchmark parser=javascript > new.log |
122 |
| -node benchmarks/diff_multi_bench_output.js old.log new.log > improvement.log |
| 113 | +npm run benchmark |
123 | 114 | ```
|
124 | 115 |
|
125 | 116 | ## License
|
|
0 commit comments