diff options
author | Jan Cholasta <jcholast@redhat.com> | 2016-05-25 12:43:02 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-06-03 09:00:34 +0200 |
commit | 11de39651f1547464ce38f013bd4d2f88141569a (patch) | |
tree | 9160c1a5d24f07ef1dfe006d2163c9b7e4611fe4 /ipalib | |
parent | 56c66f44a0e356504bf8a7edcc924777adc1b352 (diff) | |
download | freeipa-11de39651f1547464ce38f013bd4d2f88141569a.tar.gz freeipa-11de39651f1547464ce38f013bd4d2f88141569a.tar.xz freeipa-11de39651f1547464ce38f013bd4d2f88141569a.zip |
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>
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/rpc.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ipalib/rpc.py b/ipalib/rpc.py index bb03964db..adca8f5bd 100644 --- a/ipalib/rpc.py +++ b/ipalib/rpc.py @@ -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): |