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

Issue 2880953002: Measure frame decodes more accurately from ImageDecodeBench

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

Description

ImageDecodeBench currently reports the mean without reporting standard deviation / variance. This means we cannot perfectly compare before & after measurements -- we need to make sure the central limit theorem has enough samples to maintain consistent standard deviation / variance between runs. ImageDecodeBench will now report the standard deviation along with the mean so the user can verify that the before & after runs have a consistent amount of noise. In order to assist the standard deviation / variance from changing much between runs, we can also increase the precision of our timing. This patch does that by starting the timer immediately before decoding a single frame, decoding the frame, and then immediately stopping the timer. It also no longer includes setup and teardown in the measurement. Since we are now timing individual runs to find the standard deviation / variance, we also added a --raw-output command line option which saves the measurements in a csv-formatted file. This can then be used in external visualization tools. BUG=722147

Patch Set 1 #

Total comments: 24

Patch Set 2 : Code review comment fixes #

Total comments: 2

Patch Set 3 : Rebase #

Patch Set 4 : Rebase #

Patch Set 5 : Add output format comment. Remove unneccesary parameter. #

Patch Set 6 : Remove raster timing #

Total comments: 24

Patch Set 7 : Add comment clarifying new types. Use 'i' for loop indices. Don't specify blink:: #

Patch Set 8 : Print error message and return error code when failure occurs #

Total comments: 2

Patch Set 9 : Remove ClearCacheExceptFrame & calls to SetData to reset and clear #

Patch Set 10 : Clarify how output is formatted and how to use the output #

Total comments: 6

Patch Set 11 : Use 0-based index in comments. Clarify typical usage in comments #

Total comments: 1

Patch Set 12 : Create new decoder for each iteration to not allow decoder cache usage #

Patch Set 13 : Add --raw-output option. Print raw timings there #

Patch Set 14 : Output mean and variance #

Patch Set 15 : Use standard deviation instead of variance #

Patch Set 16 : Remove constexpr from variables whos usage is close in proximity #

Total comments: 10

Patch Set 17 : Fix packeted decode timing falsely erroring. Clarify comments. #

Patch Set 18 : Fix std::pow since we define our own pow. Use fabs instead of std::abs #

Total comments: 15

Patch Set 19 : Report minimum #

Patch Set 20 : Refactor out frame count #

Patch Set 21 : Fix incorrect error message when packeted decode hits incomplete frame #

Patch Set 22 : Fix treating all data received as an error in packeted decode #

Patch Set 23 : Correct variable scrope in packeted decode #

Total comments: 3

Patch Set 24 : Rebase #

Patch Set 25 : Fix reported minimum always being 0 #

Patch Set 26 : Fix formatting #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+211 lines, -59 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 14 15 16 17 18 19 20 21 22 23 24 25 5 chunks +211 lines, -59 lines 6 comments Download

Messages

Total messages: 88 (57 generated)
cblume
PTAL
3 years, 7 months ago (2017-05-14 22:55:24 UTC) #4
scroggo_chromium
Comments on the commit message: > Allow for more accurate measurements from ImageDecodeBench How about ...
3 years, 7 months ago (2017-05-15 15:59:05 UTC) #7
cblume
> How long does it take for the process to be swapped out by the ...
3 years, 7 months ago (2017-05-19 16:47:58 UTC) #19
cblume
I forgot to mention, I will separate the raster into a separate CL. I'm working ...
3 years, 7 months ago (2017-05-19 18:11:36 UTC) #22
scroggo_chromium
https://codereview.chromium.org/2880953002/diff/1/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (left): https://codereview.chromium.org/2880953002/diff/1/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#oldcode351 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:351: printf("%f %f\n", total_time, average_time); On 2017/05/19 16:47:58, cblume wrote: ...
3 years, 7 months ago (2017-05-19 21:04:16 UTC) #23
cblume
https://codereview.chromium.org/2880953002/diff/1/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (left): https://codereview.chromium.org/2880953002/diff/1/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#oldcode351 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:351: printf("%f %f\n", total_time, average_time); On 2017/05/19 21:04:15, scroggo_chromium wrote: ...
3 years, 7 months ago (2017-05-19 21:47:39 UTC) #24
cblume
I have separated the addition of raster timing into its own CL: https://codereview.chromium.org/2893023003
3 years, 7 months ago (2017-05-19 22:03:25 UTC) #27
scroggo_chromium
From the description: > Add a mode to ImageDecodeBench that measures drawing > > Some ...
3 years, 7 months ago (2017-05-22 13:07:41 UTC) #30
cblume
https://codereview.chromium.org/2880953002/diff/100001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2880953002/diff/100001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode14 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:14: // Each row represents suceessive frames in an animated ...
3 years, 7 months ago (2017-05-23 00:43:57 UTC) #33
scroggo_chromium
On 2017/05/22 13:07:41, scroggo_chromium wrote: > From the description: > > > Add a mode ...
3 years, 7 months ago (2017-05-23 15:42:23 UTC) #36
scroggo_chromium
https://codereview.chromium.org/2880953002/diff/140001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2880953002/diff/140001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode296 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:296: exit(3); On 2017/05/23 15:42:23, scroggo_chromium wrote: > Please pass ...
3 years, 7 months ago (2017-05-23 15:46:03 UTC) #37
cblume
On 2017/05/22 13:07:41, scroggo_chromium wrote: > This is still listed in the description. Removed. https://codereview.chromium.org/2880953002/diff/100001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp ...
3 years, 7 months ago (2017-05-23 19:44:35 UTC) #41
scroggo_chromium
https://codereview.chromium.org/2880953002/diff/180001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2880953002/diff/180001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode16 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:16: // Each column represents a successive iteration of decoding ...
3 years, 7 months ago (2017-05-23 21:04:23 UTC) #42
cblume
https://codereview.chromium.org/2880953002/diff/180001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2880953002/diff/180001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode16 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:16: // Each column represents a successive iteration of decoding ...
3 years, 7 months ago (2017-05-23 21:42:07 UTC) #47
cblume
https://codereview.chromium.org/2880953002/diff/200001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2880953002/diff/200001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode265 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:265: timings[i][frame_index] = elapsed_time; I was measuring decode times just ...
3 years, 7 months ago (2017-05-24 10:04:16 UTC) #50
cblume
On 2017/05/24 10:04:16, cblume wrote: > I noticed something though. The ImageDecoder's cache is working ...
3 years, 7 months ago (2017-05-26 21:43:25 UTC) #55
cblume
Ping I think some of the questions over on the "Add raster timing to ImageDecodeBench" ...
3 years, 6 months ago (2017-05-30 21:55:34 UTC) #56
cblume
Ping We mentioned reporting the mean and variance. And the raw data would use a ...
3 years, 6 months ago (2017-06-06 23:52:48 UTC) #57
cblume
Ping x3 To clarify, standard deviation and variance represent the same thing. I'm just using ...
3 years, 6 months ago (2017-06-13 17:50:39 UTC) #58
scroggo_chromium
https://codereview.chromium.org/2880953002/diff/300001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2880953002/diff/300001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode13 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:13: // If --raw-output is specified, the output is formatted ...
3 years, 6 months ago (2017-06-13 20:55:57 UTC) #59
cblume
noel@ I would like to get your thoughts as well. https://codereview.chromium.org/2880953002/diff/300001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2880953002/diff/300001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode13 ...
3 years, 6 months ago (2017-06-14 21:18:37 UTC) #62
scroggo_chromium
Please add some line breaks to your commit message. The convention is to use a ...
3 years, 6 months ago (2017-06-15 14:03:51 UTC) #71
Noel Gordon
On 2017/06/14 21:18:37, cblume wrote: > noel@ I would like to get your thoughts as ...
3 years, 6 months ago (2017-06-16 17:31:55 UTC) #72
Noel Gordon
https://codereview.chromium.org/2880953002/diff/340001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2880953002/diff/340001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode371 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:371: fprintf(stderr, "Image decode failed\n"); On 2017/06/15 14:03:51, scroggo_chromium wrote: ...
3 years, 6 months ago (2017-06-16 17:32:56 UTC) #73
cblume
On 2017/06/16 17:32:56, Noel Gordon wrote: > Why are we measuring the time of each ...
3 years, 5 months ago (2017-06-28 18:51:08 UTC) #74
cblume
Oops, quick correction: On 2017/06/28 18:51:08, cblume wrote: > Either way, it would be converging ...
3 years, 5 months ago (2017-06-28 19:04:34 UTC) #75
cblume
https://codereview.chromium.org/2880953002/diff/300001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2880953002/diff/300001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode262 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:262: double GetMean(const IterationsOfFrameTimings& timings) { On 2017/06/15 14:03:50, scroggo_chromium ...
3 years, 5 months ago (2017-07-05 08:57:55 UTC) #76
scroggo_chromium
Please reformat the commit message to have more line breaks. It's hard to read when ...
3 years, 5 months ago (2017-07-05 13:16:15 UTC) #81
Noel Gordon
https://codereview.chromium.org/2880953002/diff/440001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2880953002/diff/440001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode271 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:271: double min = 0.0; This can't be right. The ...
3 years, 5 months ago (2017-07-17 02:17:08 UTC) #82
cblume
https://codereview.chromium.org/2880953002/diff/440001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right): https://codereview.chromium.org/2880953002/diff/440001/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp#newcode271 third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:271: double min = 0.0; On 2017/07/17 02:17:08, Noel Gordon ...
3 years, 5 months ago (2017-07-17 05:47:29 UTC) #83
Noel Gordon
3 years, 5 months ago (2017-07-17 07:38:43 UTC) #88
https://codereview.chromium.org/2880953002/diff/500001/third_party/WebKit/Sou...
File third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp (right):

https://codereview.chromium.org/2880953002/diff/500001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:44: #include
<vector>
Use WTF::Vector

https://codereview.chromium.org/2880953002/diff/500001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:231: // This
vector represents a single iteration of one (possibly animated) image.
"This"? Which vector are u referring to?

https://codereview.chromium.org/2880953002/diff/500001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:261: class
MeanAndMin {
Could we make this a struct please.

https://codereview.chromium.org/2880953002/diff/500001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:292: double
difference = frame_time - mean;
1)

{
  double difference = frame_time - mean;
  squared_difference_sum += difference * difference;
  ++count;
}

here perhaps, but ...

2) can you explain why having a single _mean_ for some number of decode bench
iterations of a multi-framed image makes sense?

https://codereview.chromium.org/2880953002/diff/500001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:303: size_t
GetFrameCount(const PassRefPtr<SharedBuffer>& data) {
PassRefPtr ?  Maybe pass by raw ptr.

https://codereview.chromium.org/2880953002/diff/500001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp:343: }
Should we be testing for decoder->Failed() around here?

Powered by Google App Engine
This is Rietveld 408576698