Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eivanov89
Copy link
Member

Changelog entry

...

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

...

@eivanov89 eivanov89 requested a review from a team as a code owner June 18, 2025 08:55
@eivanov89 eivanov89 requested a review from Copilot June 18, 2025 08:55
Copy link
Contributor

@Copilot Copilot AI left a 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());

Copy link

🟢 2025-06-18 08:56:41 UTC The validation of the Pull Request description is successful.

Copy link

github-actions bot commented Jun 18, 2025

2025-06-18 08:59:10 UTC Pre-commit check linux-x86_64-release-asan for e38baa4 has started.
2025-06-18 08:59:23 UTC Artifacts will be uploaded here
2025-06-18 09:02:44 UTC ya make is running...
2025-06-18 10:05:16 UTC Check cancelled

Copy link

github-actions bot commented Jun 18, 2025

2025-06-18 09:03:25 UTC Pre-commit check linux-x86_64-relwithdebinfo for e38baa4 has started.
2025-06-18 09:03:51 UTC Artifacts will be uploaded here
2025-06-18 09:07:31 UTC ya make is running...
2025-06-18 10:05:14 UTC Check cancelled

@eivanov89 eivanov89 enabled auto-merge (squash) June 18, 2025 09:20
Copy link

github-actions bot commented Jun 18, 2025

2025-06-18 10:09:49 UTC Pre-commit check linux-x86_64-relwithdebinfo for a6af9b6 has started.
2025-06-18 10:10:40 UTC Artifacts will be uploaded here
2025-06-18 10:15:05 UTC ya make is running...
🟡 2025-06-18 12:08:10 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
38290 35562 0 2 2676 50

2025-06-18 12:11:50 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-06-18 12:24:54 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
513 (only retried tests) 483 0 0 4 26

🟢 2025-06-18 12:25:05 UTC Build successful.
🟡 2025-06-18 12:25:27 UTC ydbd size 2.2 GiB changed* by +166.9 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: abeada2 merge: a6af9b6 diff diff %
ydbd size 2 373 000 616 Bytes 2 373 171 552 Bytes +166.9 KiB +0.007%
ydbd stripped size 497 531 720 Bytes 497 551 752 Bytes +19.6 KiB +0.004%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Jun 18, 2025

2025-06-18 10:32:47 UTC Pre-commit check linux-x86_64-release-asan for a6af9b6 has started.
2025-06-18 10:32:59 UTC Artifacts will be uploaded here
2025-06-18 10:36:47 UTC ya make is running...
🟡 2025-06-18 13:01:44 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16058 15664 0 211 153 30

2025-06-18 13:03:11 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-06-18 13:40:46 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
2370 (only retried tests) 2168 0 65 109 28

2025-06-18 13:41:29 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-06-18 14:17:26 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1807 (only retried tests) 1611 0 66 105 25

🟢 2025-06-18 14:17:45 UTC Build successful.
🟢 2025-06-18 14:18:22 UTC ydbd size 3.9 GiB changed* by +3.6 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: 0ee880e merge: a6af9b6 diff diff %
ydbd size 4 174 045 320 Bytes 4 174 049 000 Bytes +3.6 KiB +0.000%
ydbd stripped size 1 447 369 528 Bytes 1 447 370 488 Bytes +960 Bytes +0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@eivanov89 eivanov89 disabled auto-merge June 18, 2025 11:35
@eivanov89 eivanov89 enabled auto-merge (squash) June 18, 2025 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant