Skip to content
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

performance improvements ideas #29

Open
basiliscos opened this issue Apr 19, 2019 · 1 comment
Open

performance improvements ideas #29

basiliscos opened this issue Apr 19, 2019 · 1 comment
Labels

Comments

@basiliscos
Copy link
Owner

basiliscos commented Apr 19, 2019

  1. Introduce prepared_command, which already holds serialized form, and yous it as item in ConstBufferSequence

in other words, the idea is to avoid output (tx) buffer linearization. Currently this technique is used with rx buffer on (and it used completely on the experimental branch).

Avoiding output linearization will really make bredis zero cost, as the user's payload will not be copied by bredis, and will be passed into OS-kernel directly.

@basiliscos
Copy link
Owner Author

@ovanes Here are preliminary experimental PR:

https://github.com/basiliscos/cpp-bredis/blob/prepared-command/examples/speed_test_async_multi.cpp

it uses writev syscall under the hood and performs zero-copy for input commands.

but the performance for the bulk of small commands actually drops to 80..90 times. So, it does not worth in general case, however it might be worth for case when bredis is data-producer, i.e. generates huge amounts of data and feeds it to redis-server.

It might be useful to have mixed mode, i.e. allow linearization as well as zero-copy, but I'll wait further requests/cases from bredis-users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant