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

perf: improve streaming performance - #240

Merged
larkee merged 2 commits into
googleapis:masterfrom
larkee:fix-207
Feb 23, 2021
Merged

perf: improve streaming performance#240
larkee merged 2 commits into
googleapis:masterfrom
larkee:fix-207

Conversation

@larkee

@larkeelarkee commented Feb 22, 2021

Copy link
Copy Markdown
Contributor

This PR fixes performance issues that were introduced during the mirgration to v2 and optimizes several streaming methods.

From v2 onwards, the library uses proto-plus to produce user friendly Python object to represent proto messages. Unfortunately, it significantly impacted the performance of streaming for cases with many columns as the library must unnecessarily parse the types many times. By reverting the streaming changes to use the raw protobuf messages, the streaming speed is greatly improved.

Fixes#207, fixes#234

@product-auto-labelproduct-auto-labelBot added the api: spanner Issues related to the googleapis/python-spanner API. label Feb 22, 2021
@google-clagoogle-claBot added the cla: yes This human has signed the Contributor License Agreement. label Feb 22, 2021
@larkee
larkee marked this pull request as ready for review February 23, 2021 05:35
@larkee
larkee requested a review from a teamFebruary 23, 2021 05:35
:param values: non-chunked values from partial result set.
"""
width = len(self.fields)
print(self.fields)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Did this make it into the final code?

@larkeelarkee mentioned this pull request Mar 1, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spannerIssues related to the googleapis/python-spanner API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: StreamedResultSet double-encodes merged byte chunks after querying, throwing error Slow _merge_values ( parsing values from protobuf to string)

3 participants

@larkee@harmon@skuruppu