rpc: optimize JSON-RPC response handling

Speed up JSON-RPC response handling by putting received response data
fragments in a list and joining them at once instead of concatenating
each fragment one by one.

https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Jan Cholasta 2016-05-25 12:43:02 +02:00
parent 56c66f44a0
commit 11de39651f

View File

@ -404,13 +404,13 @@ def xml_loads(data, encoding='UTF-8'):
class DummyParser(object):
def __init__(self):
self.data = b''
self.data = []
def feed(self, data):
self.data += data
self.data.append(data)
def close(self):
return self.data
return b''.join(self.data)
class MultiProtocolTransport(Transport):