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

Issue 2893023003: Add raster timing to ImageDecodeBench

Created:
3 years, 7 months ago by cblume
Modified:
3 years, 6 months ago
CC:
chromium-reviews, blink-reviews, kinuko+watch
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add raster timing to ImageDecodeBench When making changes to an image decoder, those changes may also effect how the decoded image is used. This means raster behavior may change as well. An example is not correcting mis-reported alpha. Raster may now go down the has-alpha path where it wouldn't before. Since image decode timing is tied to the decoded image's usage, that needs to be tracked as well. BUG=724657

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Add includes which were accidentally removed #

Total comments: 4

Patch Set 4 : Re-adding code that didn't get migrated to the new CL #

Patch Set 5 : Clarify decoded information. Use 'i' for loop variables #

Patch Set 6 : Rebase. Remove blink:: and use fprintf() / exit() like upstream #

Total comments: 6

Patch Set 7 : Rebase #

Patch Set 8 : Error when packet size and raster timing are both specified #

Patch Set 9 : Rebase #

Patch Set 10 : Create decoder inside TimeRaster #

Total comments: 26

Patch Set 11 : Rebase #

Patch Set 12 : Error immediately on failure. Simplify comment & variable name #

Patch Set 13 : Remove const from variables that are close to their usage. Move variables closer to usage #

Patch Set 14 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -12 lines) Patch
M third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 10 chunks +73 lines, -12 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 54 (41 generated)
cblume
PTAL This is from a previous CL: https://codereview.chromium.org/2880953002/ I separated that CL into smaller parts. ...
3 years, 7 months ago (2017-05-19 22:04:30 UTC) #4
scroggo_chromium
https://codereview.chromium.org/2893023003/diff/40001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2893023003/diff/40001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode312 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:312: // Force enough parsing to later determine the image's ...
3 years, 7 months ago (2017-05-22 12:50:14 UTC) #15
cblume
https://codereview.chromium.org/2893023003/diff/40001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2893023003/diff/40001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode312 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:312: // Force enough parsing to later determine the image's ...
3 years, 7 months ago (2017-05-22 21:33:02 UTC) #17
scroggo_chromium
I just want to remind you that it is helpful for your reviewers if you ...
3 years, 7 months ago (2017-05-23 15:57:09 UTC) #25
cblume
Sorry about combining the rebase with code changes. I realized the mistake as I was ...
3 years, 7 months ago (2017-05-23 18:07:31 UTC) #26
scroggo_chromium
lgtm https://codereview.chromium.org/2893023003/diff/100001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2893023003/diff/100001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode401 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:401: packet_size = strtol(argv[3], &end, 10); On 2017/05/23 18:07:31, ...
3 years, 7 months ago (2017-05-23 18:41:19 UTC) #27
cblume
Noel@ I think this is ready for your approval. (Although this relates to image decoder, ...
3 years, 7 months ago (2017-05-23 19:18:40 UTC) #30
cblume
Note: We will want to finish the upstream changes so I don't submit-after-lgtm.
3 years, 7 months ago (2017-05-23 19:21:59 UTC) #31
Noel Gordon
https://codereview.chromium.org/2893023003/diff/180001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2893023003/diff/180001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode12 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:12: // ./out/Release/image_decode_bench file [--raster] [iterations] Remove this change, just ...
3 years, 7 months ago (2017-05-25 13:01:59 UTC) #42
cblume
https://codereview.chromium.org/2893023003/diff/180001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2893023003/diff/180001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode12 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:12: // ./out/Release/image_decode_bench file [--raster] [iterations] On 2017/05/25 13:01:59, noel ...
3 years, 6 months ago (2017-05-30 21:55:08 UTC) #44
Noel Gordon
https://codereview.chromium.org/2893023003/diff/180001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2893023003/diff/180001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode350 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:350: const bool all_data_received = true; On 2017/05/30 21:55:08, cblume ...
3 years, 6 months ago (2017-05-31 16:31:29 UTC) #48
cblume
https://codereview.chromium.org/2893023003/diff/180001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2893023003/diff/180001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode350 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:350: const bool all_data_received = true; On 2017/05/31 16:31:29, noel ...
3 years, 6 months ago (2017-05-31 22:49:32 UTC) #49
Noel Gordon
3 years, 6 months ago (2017-06-05 13:39:52 UTC) #54
https://codereview.chromium.org/2893023003/diff/180001/third_party/WebKit/Sou...
File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right):

https://codereview.chromium.org/2893023003/diff/180001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:350: const bool
all_data_received = true;
On 2017/05/31 22:49:32, cblume wrote:
> On 2017/05/31 16:31:29, noel gordon wrote:
> > line 295 right: 
> >   constexpr bool total_all_data_received = true;
> > line 313 right:
> >   bool all_data_received = position == data->size();
> > line 350 left:
> >   const bool all_data_received = true;
> > Point is, please be consistent.
> 
> I'm embarrassed :)
> Consolidated to non-const(expr).

Thanks.

> > > I have a separate bit of work (will be a separate CL) to change this
> parameter
> > > from a bool to an enum so it will be self-documenting. It is amazing how
> much
> > > code calls ImageDecoder::SetData either directly or indirectly.
> > 
> > Admirable, but maybe a P4.  Main P0 would be to focus on getting skia
decoders
> > enabled in blink.
> 
> I strongly agree. That's why I haven't gotten to the point of it having a CL.
> It's ultra-backburner.

Nod.

https://codereview.chromium.org/2893023003/diff/180001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:356: }
On 2017/05/31 22:49:32, cblume wrote:
> On 2017/05/31 16:31:29, noel gordon wrote:
> > On 2017/05/30 21:55:08, cblume wrote:
> > > On 2017/05/25 13:01:59, noel gordon wrote:
> > > > } 
> > > > 
> > > > const auto size = decoder->Size();
> > > 
> > > Done.
> > 
> > Ok, next step would be to move it where used.
> 
> Done.
> Also removed the const since it is now close.

Good.

https://codereview.chromium.org/2893023003/diff/180001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:377:
printf("%f,\n", iteration_time);
On 2017/05/31 22:49:32, cblume wrote:
> On 2017/05/31 16:31:29, noel gordon wrote:
> > Statistical estimation requires that we invoke the Central Limit Theorem
> (CLT),
> > which says sufficient samples must be taken for the sample mean to converge
> the
> > actual population mean of the data with low variance.
> 
> I agree with what you are saying that we can get the mean & variance.

Well, we agree with the CLT :)

> I feel like if I only had those I would be missing important information
still.
> Although, perhaps this isn't always true.
> 
> For example, when timing raster when we corrected alpha I saw that the min
> values were the same. But there was added noise when not correcting alpha,
which
> was a clue to me.
> 
> If I simply took enough samples to get a small variance, I would be ignoring
the
> fact that the noise was important. It clued me into what may have been causing
a
> different mean.
> 
> There is a similar story for the only-Complete-the-last-frame.

OK.

> However, I do strongly agree that this might be so unwieldy that 1.) it
> discourages use of this tool at all, and 2.) maybe we don't always need it.
> 
> What do you think about me adding a command line parameter to output this?
That
> way by default it can only output the mean & variance. But if you want to look
> under thf e hood you can.

Sounds like a good idea to me.  We should be able to look under the hood, to see
the variance if wanted, and to see the per-run decode timings (eg., 500 decode
times for a given image) if wanted.

> > So are you telling me that if I decode a PNG, a single frame image, the
frame
> is
> > not marked frame complete?  Perhaps the problem is related to animated image
> > frames only, which is either a bug in our decoders (doubtful) or a bug in
the
> > changes you have made to the image benchmark tool.
> 
> For single-frame images, once decoded, the frame is marked as complete.
> For multi-frame images, only the last frame seems to be marked as complete.
> 
> It may only be a bug in my changes. I hope that is the case.
> It showed up in https://codereview.chromium.org/2880953002/ patch set 11.
> Patch set 12 creates a new image decoder for each iteration because the frame
> cache was not actually timing decodes.
> But that mistake is why I noticed at all.
> 
> I'll be investigating it further soon.

Yes please investigate the source of this error.  All frames should be marked
complete, there should be no partial frame decodes, since we have all the
encoded data of valid images, and should be sending all that data to the image
decoder.

Powered by Google App Engine
This is Rietveld 408576698