Improve performance when reading large server responses
By default, python xmlrpclib parser reads data by chunks of 1024 bytes [1], which leads to a lot of data concatenations when reading large data, which is very slow in python.
The attached patch overrides parse_response function in order to read all the data directly, so the performance is improved.
We have done the following test:
1. Create a new database with ir module, and create an ir.attachment with a file of 20MB.
2. Open the attachment list from Administration -> Models -> Attachments.
And have observed the following results:
with patch: 0.245282sec
without patch: 1min 48.933491sec
So this is a huge difference in user experience.
This not only affects on attachments, but also improves the time of openning big reports.
[1] https://hg.python.org/cpython/file/2.7/Lib/xmlrpclib.py#l1479