Skip to content

Conversation

@mdumandag
Copy link
Contributor

we were looping over the result to convert the byte array into a list. This was causing a huge latency problem when the result we iterate over is huge. With this change, the conversion is delegated to python itself.

By the way, read_byte_array method returns list of byte sized integers, not a byte array. I think we can just return the result without converting it to a list since bytearray is special type in python. If we do that, we can also change the read_utf method to something like this as we did in the Node.js client

def read_utf(self):
  result = self.read_byte_array()
  if result is None:
    return None
  return result.decode("utf-8")

This read_utf change solves the issue described in #149. The duration of the string read test described in the issue goes from 35 seconds to 100-200 milliseconds in my laptop.

@mdumandag mdumandag requested review from sancar and tkountis June 21, 2019 09:35
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.

2 participants