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

Issue 1877873002: Reduce wait times for very large PEXE files. (Closed)

Created:
4 years, 8 months ago by Karl
Modified:
4 years, 8 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Reduce wait times for very large PEXE files. Investigated how many parser waits occur when the OptQ fills up. The current implementation has 64k entries, which for 10Mb examples, never fill up (but do come close to filling up). To test, I dropped the queue size down. The numbers I got was that the queue size plus the number of parse waits was within 2% of the total number of function blocks. Hence, once OptQ fills up a lot of slow notifies get applied. Hence, for scaling, I modifed the code to not wake up the parse thread (during a pop) until OptQ got half empty. The results were that once the Opt got up to size 1024, less than 100 notifies would be issued. From 1024 on, as the queue size doubled, the number of notifies would drop roughly in half. Based on this, I decided to add the feature that the OptQ did not wake up the waiting parse thread until half empty. Since the queue size was not shrunk, this CL shouldn't add any overhead for the PEXES we have, and very few waits with significantly largers than the current (10Mb) PEXES. BUG=None R=jpp@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=3018cf2b3e0b58a13b6b1e31cb27c5f0a7fd0c37

Patch Set 1 #

Patch Set 2 : Fix nits. #

Total comments: 4

Patch Set 3 : Fix nit. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -9 lines) Patch
M src/IceGlobalContext.h View 2 chunks +7 lines, -1 line 1 comment Download
M src/IceGlobalContext.cpp View 1 2 2 chunks +16 lines, -6 lines 0 comments Download
M src/IceThreading.h View 2 chunks +2 lines, -2 lines 1 comment Download

Messages

Total messages: 9 (3 generated)
Karl
4 years, 8 months ago (2016-04-11 16:24:12 UTC) #3
John
lgtm https://codereview.chromium.org/1877873002/diff/20001/src/IceGlobalContext.cpp File src/IceGlobalContext.cpp (right): https://codereview.chromium.org/1877873002/diff/20001/src/IceGlobalContext.cpp#newcode952 src/IceGlobalContext.cpp:952: return std::unique_ptr<OptWorkItem>(OptQ.blockingPop(OptQWakeupSize)); Not really your fault, but can ...
4 years, 8 months ago (2016-04-11 16:28:00 UTC) #4
Jim Stichnoth
Quick drive-by since I'm on vacation. Consider using this bug: https://bugs.chromium.org/p/nativeclient/issues/detail?id=4081 Have you stress-tested this ...
4 years, 8 months ago (2016-04-11 16:46:09 UTC) #5
Karl
I have checked out if it works for small sizes, with large thread pointers. I ...
4 years, 8 months ago (2016-04-11 21:48:54 UTC) #6
Karl
Committed patchset #3 (id:40001) manually as 3018cf2b3e0b58a13b6b1e31cb27c5f0a7fd0c37 (presubmit successful).
4 years, 8 months ago (2016-04-11 21:49:06 UTC) #8
Jim Stichnoth
4 years, 8 months ago (2016-04-13 15:33:19 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/1877873002/diff/40001/src/IceGlobalContext.h
File src/IceGlobalContext.h (right):

https://codereview.chromium.org/1877873002/diff/40001/src/IceGlobalContext.h#...
src/IceGlobalContext.h:480: /// Number of function blocks that can be queued
before waiting for
reflow comment

https://codereview.chromium.org/1877873002/diff/40001/src/IceThreading.h
File src/IceThreading.h (right):

https://codereview.chromium.org/1877873002/diff/40001/src/IceThreading.h#newc...
src/IceThreading.h:70: std::unique_ptr<T> blockingPop(size_t
NotifyWhenDownToSize = MaxStaticSize) {
Would it make sense to also apply this to blockingPush() onto the emit queue? 
The emit thread presumably also spends a lot of its time blocked waiting for
more work items, so the translator thread spends significant time notifying and
unblocking the emit thread.

Powered by Google App Engine
This is Rietveld 408576698