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

Python: CreateByteVector function in builder. #4453

Merged
merged 1 commit into from
Oct 6, 2017

Conversation

rw
Copy link
Contributor

@rw rw commented Oct 5, 2017

This adds a CreateByteVector function to the Python Builder. This handles the write path for byte vectors (we already handle the read path).

@aardappel
Copy link
Collaborator

Great! LGTM. I think there may be another out-standing issue or PR that was also asking for this.

@rw
Copy link
Contributor Author

rw commented Oct 5, 2017

It's not tested as much as CreateString but that's okay--the functionality is almost identical.

@rw
Copy link
Contributor Author

rw commented Oct 5, 2017

@jfinken Does this meet your needs?

@jfinken
Copy link

jfinken commented Oct 6, 2017

@rw, @aardappel

Wonderful. Many thanks for the swift response and the PR. It does indeed meet my needs. On my setup the serialization time for data that included the byte vector went from ~120.40ms down to ~0.27ms.
Thank you again.

@aardappel aardappel merged commit 86fb05d into google:master Oct 6, 2017
@rw
Copy link
Contributor Author

rw commented Oct 6, 2017

@jfinken Glad to hear it!

@rw rw deleted the 2017-10--python-create-byte-vector branch October 6, 2017 22:01
@@ -421,6 +421,27 @@ def CreateString(self, s, encoding='utf-8', errors='strict'):

return self.EndVector(len(x))

def CreateByteVector(self, x):
"""CreateString writes a byte vector."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this docstring correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants