dartist/redis_client — pull request #55 by patefacio (2014-12-26 19:36:18+00:00)
Title: Improve performance of stream transformer from List<int> to List<RedisReply>

When using the API I saw performance problems when large numbers of commands are sent to server. It seems the handling of response data is not performant. The socket handleData implementation has trouble keeping up with large buffer of results and 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).

So I reimplemented this transformer logic to not return remaining data from consumeData, but to rather return an index to the next datum to be read. It seems to have worked for my case. The publish.dart example in the benchmarks folder can now send 10,000 request/replies round trip in about 3 seconds on my laptop. The original would died with stack overflow after 33 minutes.

I tried to keep the original style and made the existing tests work.