dartist / redis_client

A high-performance async/non-blocking Redis client for Dart
BSD 2-Clause "Simplified" License
100 stars 29 forks source link

redis client is not as fast as it claims to be. #54

Closed ra1u closed 9 years ago

ra1u commented 9 years ago

I have made some tests and figured out that curretly on my machine client can made 3000 operations per second (SET or GET for example). One issue I found is response parser, were it does much of unecessary copying.
I made my own parser and client (just for curiosity - i am just learning dart) and was able to get 50k operations per second. It is just proof of concept and lot of optimisations remains open. I can merge it in redis_client but I wonder whatever it is accepted to have such code change and what you think about it. https://github.com/ra1u/redis_parser

Edit - I fixed tested claims

adam-singer commented 9 years ago

if you can make it faster go for it! send a pr lets review and go from there

patefacio commented 9 years ago

I saw similar performance issues. The problem I saw is when there is a blitz of publish commands sent quickly. The socket handleData implementation has trouble keeping up with large buffer of results. I can not say for sure if the original code was making too many copies as it looks like it is trying to avoid it with UnmodifiableListViews on the original data. But there is definitely a performance problem in this path of code. I tried to use observatory and found it difficult because the heavy (and unnecessary??) use of deep recursion in the data consumption side makes it difficult to navigate the web results of observatory (I still need to learn more on using this tool effectively).

I think I have addressed the issues and mad a few other fixes and will create PR. Please review and let me know your thoughts.

ra1u commented 9 years ago

I have also made some improvements and current master is now as fast as https://github.com/ra1u/redis-dart. Thanks also to patefacio there is performance improvement from 3000 operations per second to 100000 operations per second. I think this issue can be closed now.

mythz commented 9 years ago

@ra1u Great just published the latest version with your latest changes on Pub: https://pub.dartlang.org/packages/redis_client

Thanks for the PR's!