Improve the performance of HostingServiceClient._build_form_data

Review Request #1655 — Created May 13, 2019 and updated

guest398
Review Board
95dc662...
satish3
The method in question was doing multiple string concatenations with
`+=`, which is very inefficient for large number of operations becuase
each operation results in a memory allocation. We now build a single
string with string interpolation for each field and file passed in and
join all the blobs together, which will require only a single memory
allocation for the final string, instead of `O(|fields| + |files|)`
allocations.

Testing Done:
Ran unit tests.

Reviewed at https://reviews.reviewboard.org/r/8910/


Loading...