Improve the performance of HostingServiceClient._build_form_data

Review Request #8910 - Created April 21, 2017 and submitted

Barret Rennie
Review Board
release-2.5.x
8909
8911
reviewboard

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.

Ran unit tests.

  • 0
  • 8
  • 0
  • 8
Description From Last Updated
Christian Hammond
Barret Rennie
Barret Rennie
David Trowbridge
Barret Rennie
David Trowbridge
Barret Rennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.5.x (1579fb5)
Loading...