NodeRedis / node-redis-parser

A high performance Redis protocol (RESP) parser for JavaScript. Used by Node Redis & ioredis.
MIT License
88 stars 36 forks source link

Misc Performance #1

Closed Salakar closed 8 years ago

Salakar commented 8 years ago

https://github.com/NodeRedis/node-redis-parser/blob/master/lib/javascript.js#L42 changing this huge if else block to a switch would improve the perf quite a bit 👍

Would do a PR myself but my battery is at 4%, send help. 🆘

EDIT: doing a PR now, lots of perf increases!

Salakar commented 8 years ago

I'll make a PR with benchmarks. Closing.