Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

fix: directly append to pb for better read row performance#382

Merged
crwilcox merged 1 commit intomasterfrom
improve-read-row-perf
Jul 20, 2021
Merged

fix: directly append to pb for better read row performance#382
crwilcox merged 1 commit intomasterfrom
improve-read-row-perf

Conversation

@crwilcox
Copy link
Copy Markdown
Contributor

Interacting directly with _pb rather than proto-plus gives a significant performance advantage.

@crwilcox crwilcox requested a review from a team July 20, 2021 16:14
@crwilcox crwilcox requested a review from a team as a code owner July 20, 2021 16:14
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/python-bigtable API. label Jul 20, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 20, 2021
"""
for each in self.row_keys:
message.rows.row_keys.append(_to_bytes(each))
message.rows.row_keys._pb.append(_to_bytes(each))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it at all possible we could run into the same issues we same here with lazy eval? #359

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't expect so. We have applied a similar patch to firestore and pubsub libraries. row_keys.append calls proto plus which ultimately will interact with _pb. The way it does this though is not fast. :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigtable Issues related to the googleapis/python-bigtable API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants