Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Issue 781683002: Subzero: Improve the memory-related performance of the register allocator. (Closed)

Created:
6 years ago by Jim Stichnoth
Modified:
6 years ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Visibility:
Public.

Description

Subzero: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -25 lines) Patch
M src/IceRegAlloc.h View 1 chunk +14 lines, -2 lines 0 comments Download
M src/IceRegAlloc.cpp View 1 13 chunks +24 lines, -23 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
Jim Stichnoth
This looks like about 2% gain on translating pnacl-llc.pexe.
6 years ago (2014-12-04 01:14:13 UTC) #2
jvoung (off chromium)
cool LGTM otherwise https://codereview.chromium.org/781683002/diff/1/src/IceRegAlloc.cpp File src/IceRegAlloc.cpp (right): https://codereview.chromium.org/781683002/diff/1/src/IceRegAlloc.cpp#newcode222 src/IceRegAlloc.cpp:222: Inactive.reserve(Unhandled.size()); Should this be after initForGlobal/initForInfOnly? ...
6 years ago (2014-12-04 02:46:44 UTC) #3
Jim Stichnoth
https://codereview.chromium.org/781683002/diff/1/src/IceRegAlloc.cpp File src/IceRegAlloc.cpp (right): https://codereview.chromium.org/781683002/diff/1/src/IceRegAlloc.cpp#newcode222 src/IceRegAlloc.cpp:222: Inactive.reserve(Unhandled.size()); On 2014/12/04 02:46:44, jvoung wrote: > Should this ...
6 years ago (2014-12-04 04:25:17 UTC) #4
Jim Stichnoth
6 years ago (2014-12-04 04:30:43 UTC) #5
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
4ead35a7e6d1d04d8cab5db23299fb5c2fe1943d (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698