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

Issue 1044363002: Add timing SkCodec to nanobench. (Closed)

Created:
5 years, 8 months ago by scroggo
Modified:
5 years, 8 months ago
Reviewers:
msarett, mtklein, djsollen
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Add timing SkCodec to nanobench. CodecBench: Add new class for timing using SkCodec. DecodingBench: Include creating a decoder inside the loop. This is to have a better comparison against SkCodec. SkCodec's factory function does not necessarily read the same amount as SkImageDecoder's, so in order to have a meaningful comparison, read the entire stream from the beginning. Also for comparison, create a new SkStream from the SkData each time. Add a debugging check to make sure we have an SkImageDecoder. Add include guards. nanobench.cpp: Decode using SkCodec. When decoding using SkImageDecoder, exclude benches where we decoded to a different color type than requested. SkImageDecoder may decide to decode to a different type, in which case the name is misleading. TODOs: Now that we ignore color types that do not match the desired color type, we should add Index8. This also means calling the more complex version of getPixels so CodecBench can support kIndex8. BUG=skia:3257 Committed: https://skia.googlesource.com/skia/+/60869a42a133942f852dd0f1696444c2a5c9ad83

Patch Set 1 #

Total comments: 18

Patch Set 2 : Move allocation outside of the loop. #

Total comments: 4

Patch Set 3 : Use SkData in CodecBench instead of SkStream. #

Patch Set 4 : Use SkData in DecodingBench as well. #

Patch Set 5 : Do not leak fData. #

Patch Set 6 : CodecBench decodes to fColorType, as intended. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+221 lines, -15 lines) Patch
A bench/CodecBench.h View 1 2 3 1 chunk +39 lines, -0 lines 0 comments Download
A bench/CodecBench.cpp View 1 2 3 4 5 1 chunk +66 lines, -0 lines 0 comments Download
M bench/DecodingBench.h View 1 2 3 2 chunks +13 lines, -6 lines 0 comments Download
M bench/DecodingBench.cpp View 1 2 3 4 4 chunks +54 lines, -7 lines 0 comments Download
M bench/nanobench.cpp View 5 chunks +47 lines, -2 lines 0 comments Download
M gyp/bench.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M gyp/iOSShell.gyp View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 22 (6 generated)
scroggo
https://codereview.chromium.org/1044363002/diff/1/bench/nanobench.cpp File bench/nanobench.cpp (right): https://codereview.chromium.org/1044363002/diff/1/bench/nanobench.cpp#newcode642 bench/nanobench.cpp:642: SkASSERT(codec); Maybe we should add the filter from DM ...
5 years, 8 months ago (2015-03-31 19:20:03 UTC) #2
msarett
This looks good. I'm just curious how much we think calling duplicate() will affect the ...
5 years, 8 months ago (2015-04-01 14:44:36 UTC) #3
scroggo
https://codereview.chromium.org/1044363002/diff/1/bench/CodecBench.cpp File bench/CodecBench.cpp (right): https://codereview.chromium.org/1044363002/diff/1/bench/CodecBench.cpp#newcode57 bench/CodecBench.cpp:57: codec.reset(SkCodec::NewFromStream(fStream->duplicate())); On 2015/04/01 14:44:36, msarett wrote: > It's unfortunate ...
5 years, 8 months ago (2015-04-01 14:59:49 UTC) #4
mtklein
> My limited understanding of nanobench is that it figures out the best number of ...
5 years, 8 months ago (2015-04-01 15:04:09 UTC) #5
mtklein
https://codereview.chromium.org/1044363002/diff/1/bench/CodecBench.cpp File bench/CodecBench.cpp (right): https://codereview.chromium.org/1044363002/diff/1/bench/CodecBench.cpp#newcode36 bench/CodecBench.cpp:36: #ifdef SK_DEBUG Seems fine in Release too. https://codereview.chromium.org/1044363002/diff/1/bench/CodecBench.cpp#newcode57 bench/CodecBench.cpp:57: ...
5 years, 8 months ago (2015-04-01 15:17:22 UTC) #6
djsollen
https://codereview.chromium.org/1044363002/diff/1/bench/nanobench.cpp File bench/nanobench.cpp (right): https://codereview.chromium.org/1044363002/diff/1/bench/nanobench.cpp#newcode638 bench/nanobench.cpp:638: for (; fCurrentCodec < fImages.count(); fCurrentCodec++) { range based ...
5 years, 8 months ago (2015-04-01 16:06:07 UTC) #7
scroggo
New patch set up for review. https://codereview.chromium.org/1044363002/diff/1/bench/CodecBench.cpp File bench/CodecBench.cpp (right): https://codereview.chromium.org/1044363002/diff/1/bench/CodecBench.cpp#newcode36 bench/CodecBench.cpp:36: #ifdef SK_DEBUG On ...
5 years, 8 months ago (2015-04-01 17:18:04 UTC) #8
mtklein
https://codereview.chromium.org/1044363002/diff/1/bench/CodecBench.cpp File bench/CodecBench.cpp (right): https://codereview.chromium.org/1044363002/diff/1/bench/CodecBench.cpp#newcode57 bench/CodecBench.cpp:57: codec.reset(SkCodec::NewFromStream(fStream->duplicate())); On 2015/04/01 17:18:04, scroggo wrote: > On 2015/04/01 ...
5 years, 8 months ago (2015-04-01 17:22:19 UTC) #9
djsollen
https://codereview.chromium.org/1044363002/diff/20001/bench/CodecBench.cpp File bench/CodecBench.cpp (right): https://codereview.chromium.org/1044363002/diff/20001/bench/CodecBench.cpp#newcode39 bench/CodecBench.cpp:39: SkASSERT(codec); do the assert on line 52 to avoid ...
5 years, 8 months ago (2015-04-01 17:23:50 UTC) #10
scroggo
https://codereview.chromium.org/1044363002/diff/1/bench/CodecBench.cpp File bench/CodecBench.cpp (right): https://codereview.chromium.org/1044363002/diff/1/bench/CodecBench.cpp#newcode57 bench/CodecBench.cpp:57: codec.reset(SkCodec::NewFromStream(fStream->duplicate())); On 2015/04/01 17:22:19, mtklein wrote: > On 2015/04/01 ...
5 years, 8 months ago (2015-04-01 17:40:54 UTC) #11
djsollen
lgtm
5 years, 8 months ago (2015-04-01 17:45:34 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1044363002/80001
5 years, 8 months ago (2015-04-01 18:02:21 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: Build-Ubuntu-Clang-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-Clang-x86_64-Debug-Trybot/builds/262)
5 years, 8 months ago (2015-04-01 18:04:03 UTC) #17
scroggo
On 2015/04/01 18:04:03, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
5 years, 8 months ago (2015-04-01 18:22:29 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1044363002/100001
5 years, 8 months ago (2015-04-01 18:22:50 UTC) #21
commit-bot: I haz the power
5 years, 8 months ago (2015-04-01 19:09:20 UTC) #22
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://skia.googlesource.com/skia/+/60869a42a133942f852dd0f1696444c2a5c9ad83

Powered by Google App Engine
This is Rietveld 408576698