-
Notifications
You must be signed in to change notification settings - Fork 695
Speedup bulkupsert (#17333) #19793
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
base: main
Are you sure you want to change the base?
Speedup bulkupsert (#17333) #19793
Conversation
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.
Pull Request Overview
This PR aims to speed up the bulk upsert operation by replacing the assignment of proto messages with swap operations to avoid unnecessary copying.
- Replaces the assignment of proto types and values with Swap in the bulk upsert requests.
- Applies the change in two files to improve runtime efficiency.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
ydb/public/sdk/cpp/src/client/table/impl/table_client.cpp | Uses Swap for proto types and values in bulk upsert request |
ydb/public/sdk/cpp/client/ydb_table/impl/table_client.cpp | Uses Swap for proto types and values in bulk upsert request |
Comments suppressed due to low confidence (2)
ydb/public/sdk/cpp/src/client/table/impl/table_client.cpp:995
- Swapping the proto data avoids copying, which improves performance. Please confirm that the rows object being modified by Swap is acceptable and consider adding a comment to document this intentional side-effect.
request.mutable_rows()->mutable_type()->Swap(&rows.GetType().GetProto());
ydb/public/sdk/cpp/client/ydb_table/impl/table_client.cpp:940
- Using Swap improves efficiency by eliminating a copy, but ensure that modifying rows through Swap is intended. Adding an inline comment to clarify the swap semantics would help maintainability.
request.mutable_rows()->mutable_type()->Swap(&rows.GetType().GetProto());
🟢 |
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
Changelog entry
...
Changelog category
Description for reviewers
...