diff options
author | mtklein <mtklein@chromium.org> | 2014-09-03 14:06:47 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-03 14:06:48 -0700 |
commit | 9c7207b5dc71dc5a96a2eb107d401133333d5b6f (patch) | |
tree | d4a19230e5516cb03513c5ad15ab9779dc3eeac0 /gyp | |
parent | 00b76bd750e668a6989dd497313e715d1b476fdc (diff) |
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:
R=caryclark@google.com, bsalomon@google.com, bungeman@google.com, mtklein@google.com, reed@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/531653002
Diffstat (limited to 'gyp')
-rw-r--r-- | gyp/dm.gypi | 2 | ||||
-rwxr-xr-x | gyp/pathops_skpclip.gyp | 3 | ||||
-rw-r--r-- | gyp/pathops_unittest.gyp | 1 | ||||
-rw-r--r-- | gyp/tools.gyp | 1 | ||||
-rw-r--r-- | gyp/utils.gypi | 1 |
5 files changed, 6 insertions, 2 deletions
diff --git a/gyp/dm.gypi b/gyp/dm.gypi index 1ecccd82b2..0d8652fd22 100644 --- a/gyp/dm.gypi +++ b/gyp/dm.gypi @@ -47,6 +47,8 @@ '../gm/gm.cpp', '../gm/gm_expectations.cpp', + '../src/utils/SkTaskGroup.cpp', + '../src/pipe/utils/SamplePipeControllers.cpp', '../src/utils/debugger/SkDebugCanvas.cpp', '../src/utils/debugger/SkDrawCommand.cpp', diff --git a/gyp/pathops_skpclip.gyp b/gyp/pathops_skpclip.gyp index a1e51d65f8..32a909bd47 100755 --- a/gyp/pathops_skpclip.gyp +++ b/gyp/pathops_skpclip.gyp @@ -15,7 +15,7 @@ '../src/pipe/utils', '../src/utils', ], - 'dependencies': [ + 'dependencies': [ 'flags.gyp:flags', 'skia_lib.gyp:skia_lib', 'tools.gyp:crash_handler', @@ -24,6 +24,7 @@ 'sources': [ '../tests/PathOpsDebug.cpp', '../tests/PathOpsSkpClipTest.cpp', + '../src/utils/SkTaskGroup.cpp', ], 'conditions': [ [ 'skia_android_framework == 1', { diff --git a/gyp/pathops_unittest.gyp b/gyp/pathops_unittest.gyp index d3152d2cf3..98e74bd54c 100644 --- a/gyp/pathops_unittest.gyp +++ b/gyp/pathops_unittest.gyp @@ -20,6 +20,7 @@ '../tests/PathOpsDebug.cpp', '../tests/PathOpsOpLoopThreadedTest.cpp', '../tests/skia_test.cpp', + '../src/utils/SkTaskGroup.cpp', ], 'conditions': [ [ 'skia_android_framework == 1', { diff --git a/gyp/tools.gyp b/gyp/tools.gyp index 66b84db66f..ce397f3cf3 100644 --- a/gyp/tools.gyp +++ b/gyp/tools.gyp @@ -167,6 +167,7 @@ '../tools/skpdiff/SkImageDiffer.cpp', '../tools/skpdiff/SkPMetric.cpp', '../tools/skpdiff/skpdiff_util.cpp', + '../src/utils/SkTaskGroup.cpp', ], 'include_dirs': [ '../src/core/', # needed for SkTLList.h diff --git a/gyp/utils.gypi b/gyp/utils.gypi index 9156b847c8..e62d287bb9 100644 --- a/gyp/utils.gypi +++ b/gyp/utils.gypi @@ -10,7 +10,6 @@ # Classes for a threadpool. '<(skia_src_path)/utils/SkCondVar.h', '<(skia_src_path)/utils/SkRunnable.h', - '<(skia_src_path)/utils/SkThreadPool.h', '<(skia_src_path)/utils/SkCondVar.cpp', '<(skia_include_path)/utils/SkBoundaryPatch.h', |