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

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

Merged
merged 1 commit into from Jul 20, 2021

Conversation

crwilcox
Copy link
Contributor

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

@crwilcox crwilcox requested review from a team as code owners 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
@@ -137,7 +137,7 @@ def _update_message_request(self, message):
:param message: The ``ReadRowsRequest`` protobuf
"""
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
Collaborator

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
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 join this conversation on GitHub. Already have an account? Sign in to comment
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.

None yet

3 participants