New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimization for ValueListOutput #573
Comments
I think there's some potential to improve. Redis array responses contain the size in their header. When using streaming, outputs don't really require an eager initialization with It would make sense to distinguish and have a late initialization that either initializes |
Good idea, the latter is what I did for our use case already as soon as I discovered it. I really like the layered API of lettuce, so I can easily choose convenience or maximum control and performance. |
Together with a few other optimizations (Returning 4.4
4.3
|
Lettuce now allocates lazily array output targets (Maps, ArrayList) with the appropriate size initialization. Optimize Subscriber to pass in the target to avoid ListSubscriber instances and convert it to a class for improved CHA/omit call-devirtualization.
Lettuce now allocates lazily array output targets (Maps, ArrayList) with the appropriate size initialization. Optimize Subscriber to pass in the target to avoid ListSubscriber instances and convert it to a class for improved CHA/omit call-devirtualization.
Done. |
Quite a nice speedup :-) |
There are many cases where a ValueListOutput is used when the amount of returned values is known
like com.lambdaworks.redis.RedisCommandBuilder.zrange(K, long, long) will have stop-start and
com.lambdaworks.redis.RedisCommandBuilder.hmget(K, K...) will have keys.length
For that we could add a second constructor that takes an additional capacity argument for the array list. backwards compatible would be to use "10" as capacity.
what do you think?
The text was updated successfully, but these errors were encountered: