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

Issue 531653002: SkThreadPool ~~> SkTaskGroup (Closed)

Created:
6 years, 3 months ago by mtklein_C
Modified:
6 years, 3 months ago
CC:
reviews_skia.org, jvanverth1
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

SkThreadPool ~~> SkTaskGroup SkTaskGroup is like SkThreadPool except the threads stay in one global pool. Each SkTaskGroup itself is tiny (4 bytes) and its wait() method applies only to tasks add()ed to that instance, not the whole thread pool. This means we don't need to bring up new thread pools when tests themselves want to use multithreading (e.g. pathops, quilt). We just create a new SkTaskGroup and wait for that to complete. This should be more efficient, and allow us to expand where we use threads to really latency sensitive places. E.g. we can probably now use these in nanobench for CPU .skp rendering. Now that all threads are sharing the same pool, I think we can remove most of the custom mechanism pathops tests use to control threading. They'll just ride on the global pool with all other tests now. This (temporarily?) removes the GPU multithreading feature from DM, which we don't use. On my desktop, DM runs a little faster (57s -> 55s) in Debug, and a lot faster in Release (36s -> 24s). The bots show speedups of similar proportions, cutting more than a minute off the N4/Release and Win7/Debug runtimes. BUG=skia: Committed: https://skia.googlesource.com/skia/+/9c7207b5dc71dc5a96a2eb107d401133333d5b6f Committed: https://skia.googlesource.com/skia/+/406654be7a930b484159f5bca107d3b11d8a9ede

Patch Set 1 #

Patch Set 2 : break -> continue #

Patch Set 3 : cleanup allowThreaded() #

Total comments: 1

Patch Set 4 : Suppress thread leaks for Valgrind. #

Patch Set 5 : Lazy and leaky -> proactive and clean. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+293 lines, -386 lines) Patch
M dm/DM.cpp View 1 2 3 4 4 chunks +4 lines, -2 lines 0 comments Download
M dm/DMQuiltTask.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M dm/DMTask.h View 3 chunks +5 lines, -4 lines 0 comments Download
M dm/DMTask.cpp View 2 chunks +10 lines, -10 lines 0 comments Download
M dm/DMTaskRunner.h View 1 2 3 4 2 chunks +5 lines, -8 lines 0 comments Download
M dm/DMTaskRunner.cpp View 1 2 3 4 1 chunk +7 lines, -11 lines 0 comments Download
M dm/DMTestTask.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M dm/DMTestTask.cpp View 1 2 1 chunk +1 line, -7 lines 0 comments Download
M gyp/dm.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M gyp/pathops_skpclip.gyp View 2 chunks +2 lines, -1 line 0 comments Download
M gyp/pathops_unittest.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M gyp/tools.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M gyp/utils.gypi View 1 chunk +0 lines, -1 line 0 comments Download
M src/utils/SkRunnable.h View 1 1 chunk +2 lines, -11 lines 0 comments Download
A src/utils/SkTaskGroup.h View 1 2 3 4 1 chunk +36 lines, -0 lines 0 comments Download
A src/utils/SkTaskGroup.cpp View 1 2 3 4 1 chunk +143 lines, -0 lines 0 comments Download
D src/utils/SkThreadPool.h View 1 chunk +0 lines, -221 lines 0 comments Download
M tests/OnceTest.cpp View 3 chunks +5 lines, -5 lines 0 comments Download
M tests/PathOpsExtendedTest.h View 1 chunk +1 line, -1 line 0 comments Download
M tests/PathOpsExtendedTest.cpp View 3 chunks +2 lines, -3 lines 0 comments Download
M tests/PathOpsOpCubicThreadedTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/PathOpsOpLoopThreadedTest.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M tests/PathOpsOpRectThreadedTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/PathOpsQuadLineIntersectionThreadedTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/PathOpsSimplifyDegenerateThreadedTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/PathOpsSimplifyQuadThreadedTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/PathOpsSimplifyQuadralateralsThreadedTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/PathOpsSimplifyRectThreadedTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/PathOpsSimplifyTrianglesThreadedTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/PathOpsSkpClipTest.cpp View 1 2 3 14 chunks +15 lines, -29 lines 0 comments Download
M tests/PathOpsThreadedCommon.h View 1 chunk +1 line, -5 lines 0 comments Download
M tests/PathOpsThreadedCommon.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M tests/PathOpsTightBoundsTest.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M tests/SkpSkGrTest.cpp View 1 2 4 chunks +6 lines, -9 lines 0 comments Download
M tests/Test.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M tests/Test.cpp View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M tests/skia_test.cpp View 1 2 3 4 5 chunks +5 lines, -5 lines 0 comments Download
M tools/flags/SkCommonFlags.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M tools/flags/SkCommonFlags.cpp View 1 2 2 chunks +2 lines, -5 lines 0 comments Download
M tools/iOSShell.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M tools/skpdiff/SkDiffContext.cpp View 6 chunks +6 lines, -11 lines 0 comments Download
M tools/skpdiff/skpdiff_main.cpp View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (5 generated)
mtklein_C
6 years, 3 months ago (2014-09-02 08:24:07 UTC) #2
mtklein
6 years, 3 months ago (2014-09-03 19:00:17 UTC) #4
mtklein
6 years, 3 months ago (2014-09-03 19:06:29 UTC) #6
reed1
api lgtm https://codereview.chromium.org/531653002/diff/40001/src/utils/SkRunnable.h File src/utils/SkRunnable.h (right): https://codereview.chromium.org/531653002/diff/40001/src/utils/SkRunnable.h#newcode11 src/utils/SkRunnable.h:11: struct SkRunnable { SkLambda ? :)
6 years, 3 months ago (2014-09-03 19:16:22 UTC) #7
bsalomon
On 2014/09/03 19:06:29, mtklein wrote: On windows time dm --nogms before: 3m58.878s after: 1m41.974s
6 years, 3 months ago (2014-09-03 19:21:06 UTC) #8
caryclark
lgtm
6 years, 3 months ago (2014-09-03 19:38:40 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/mtklein@chromium.org/531653002/60001
6 years, 3 months ago (2014-09-03 20:55:00 UTC) #11
mtklein
Jim, FYI, there's a very good chance this CL could cause some bot chaos. It ...
6 years, 3 months ago (2014-09-03 20:57:25 UTC) #12
commit-bot: I haz the power
Committed patchset #4 (id:60001) as 9c7207b5dc71dc5a96a2eb107d401133333d5b6f
6 years, 3 months ago (2014-09-03 21:06:54 UTC) #13
mtklein
A revert of this CL (patchset #4 id:60001) has been created in https://codereview.chromium.org/533393002/ by mtklein@google.com. ...
6 years, 3 months ago (2014-09-03 21:16:19 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/mtklein@chromium.org/531653002/80001
6 years, 3 months ago (2014-09-03 21:58:34 UTC) #16
commit-bot: I haz the power
Committed patchset #5 (id:80001) as 406654be7a930b484159f5bca107d3b11d8a9ede
6 years, 3 months ago (2014-09-03 22:34:43 UTC) #17
jvanverth1
6 years, 3 months ago (2014-09-04 13:25:45 UTC) #18
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:80001) has been created in
https://codereview.chromium.org/540013002/ by jvanverth@google.com.

The reason for reverting is: It's blocking the DEPS roll.  Error in
linux_chromium_gn_rel is:

ERROR at //skia/BUILD.gn:330:3: Item not found
  "//third_party/skia/src/utils/SkThreadPool.h",
  ^--------------------------------------------
You were trying to remove "//third_party/skia/src/utils/SkThreadPool.h"
from the list but it wasn't there..

Powered by Google App Engine
This is Rietveld 408576698