DescriptionSubzero: Improve the memory-related performance of the register allocator.
Profiling indicated a noticeable amount of time spent on malloc/free related to the std::list<> implementation of UnorderedRanges. Therefore, we change the implementation to be std::vector<>, and up-front reserve a conservative amount of space to avoid expansion. The push_back() operation is always constant time with no allocation. Removing an element from the middle of the vector is done by swapping with the last element and then popping the last element, which is reasonable in principle because it is used as an unordered collection. Because of the swapping trick, the UnorderedRanges iterators are changed to iterate in reverse.
BUG= none
R=jvoung@chromium.org
Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=4ead35a7e6d1d04d8cab5db23299fb5c2fe1943d
Patch Set 1 #
Total comments: 4
Patch Set 2 : Code review changes #
Messages
Total messages: 5 (1 generated)
|