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
storage/reader: Avoid some copy in mvcc reader #4373
Conversation
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@breeswish @Connor1996 PTAL! |
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@MyonKeminta Do you have some interests to work on provide references (instead of owned values) in Mvcc Scanners? This can further eliminate copies. According to my benchmarks there can be 7% improvements in the integration benchmark (using a MySQL client) |
@breeswish Of course! But I think I need some time to think about how to do that 🤔 |
@MyonKeminta I once had an experiment over this. The code is pretty awful but the outcome is great. The main challenge (of writing elegant code) is that currently we use |
Previous dirty attempt: breezewish@96afbb4 |
Thanks @morefreeze |
Sorry, why this involves me? I have no idea about these changes. Is that a misspell? |
@morefreeze Yes it should be a misspell, nevermind :) |
@siddontang Not yet. I didn't expect this PR to significantly improve the performance, but I just thought that it's never bad to remove the unnecessary copies. |
@MyonKeminta How about just KeyRef for references and Key for owned values? (I don't know. just a brain storm) |
@breeswish I don't know either before a try 😂 |
* Avoid some copy in mvcc reader Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com
What have you changed? (mandatory)
This PR tries to avoid some clones of keys in mvcc reader.
What are the type of the changes? (mandatory)
How has this PR been tested? (mandatory)
By unit tests
Does this PR affect documentation (docs) update? (mandatory)
No
Does this PR affect tidb-ansible update? (mandatory)
No