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

Issue 132573002: Add bench_record. (Closed)

Created:
6 years, 11 months ago by mtklein
Modified:
6 years, 11 months ago
Reviewers:
mtklein_C, tomhudson
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlesource.com/skia.git@master
Visibility:
Public.

Description

Add bench_record. I got fed up trying to figure out how best to measure recording cost with bench_pictures, render_pictures, etc, so I wrote a new tool. Features welcome. BUG= Committed: http://code.google.com/p/skia/source/detail?r=13037

Patch Set 1 #

Patch Set 2 : better error handling than SIGBUS and crash #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -0 lines) Patch
M gyp/tools.gyp View 2 chunks +11 lines, -0 lines 0 comments Download
A tools/bench_record.cpp View 1 1 chunk +68 lines, -0 lines 6 comments Download

Messages

Total messages: 5 (0 generated)
mtklein
6 years, 11 months ago (2014-01-09 20:36:44 UTC) #1
tomhudson
lgtm LGTM. Questions are just curiosity. https://codereview.chromium.org/132573002/diff/40001/tools/bench_record.cpp File tools/bench_record.cpp (right): https://codereview.chromium.org/132573002/diff/40001/tools/bench_record.cpp#newcode21 tools/bench_record.cpp:21: // recording, and ...
6 years, 11 months ago (2014-01-13 11:55:27 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/mtklein@google.com/132573002/40001
6 years, 11 months ago (2014-01-13 11:55:32 UTC) #3
commit-bot: I haz the power
Change committed as 13037
6 years, 11 months ago (2014-01-13 12:03:52 UTC) #4
mtklein_C
6 years, 11 months ago (2014-01-13 13:29:26 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/132573002/diff/40001/tools/bench_record.cpp
File tools/bench_record.cpp (right):

https://codereview.chromium.org/132573002/diff/40001/tools/bench_record.cpp#n...
tools/bench_record.cpp:21: // recording, and this should take ~20 seconds to
run.
On 2014/01/13 11:55:27, tomhudson wrote:
> How wildly different will this be on different platforms?
> 
> I guess the point here is to let perf capture data not dominated by loading
> costs, the way it is on other benchmarks? Since it looks like your timing is
> only around the rerecording, that number ought to be clean.

As wildly as CPUs and memory bandwidth vary.  On my laptop it takes ~30s. 
Haven't even tried on a phone yet, but I'd guess it's a couple minutes with
--loops 900.

The idea is entirely to amortize away the time it takes to read the picture so
it stays out of the way in in perf / Instruments.  If you know what you're
looking for in the profile, it should be fine to run with a much lower count,
like --loops 10.

I don't tend to look at the numbers we print out as much more than a sanity
check and a progress indicator, but you're right they don't time reading
pictures.  They should be stable with decreasing precision as --loops decreases.

I actually started with a version that ran the benchmarks in parallel.  This
gives you the same profile much faster, but at the cost of very misleading times
printed out on the screen (these are wall-timers I'm using here, not
CPU-timers).  If it would be useful to get a profile faster (down around 2-3s
IIRC),  then maybe we can add that back in as an option and have it just hide
the output when using more than one thread.

https://codereview.chromium.org/132573002/diff/40001/tools/bench_record.cpp#n...
tools/bench_record.cpp:26: DEFINE_bool(endRecording, true, "If false, don't time
SkPicture::endRecording()");
On 2014/01/13 11:55:27, tomhudson wrote:
> Why would you ever want to do that? endRecording() time is significant.

Conceivably, we could move what's done there to another thread, so
--noendRecording lets you measure the absolute recording critical path.

https://codereview.chromium.org/132573002/diff/40001/tools/bench_record.cpp#n...
tools/bench_record.cpp:28: int tool_main(int argc, char** argv);
On 2014/01/13 11:55:27, tomhudson wrote:
> Looks like this is an iOS thing? I don't recall seeing it before in the Skia
> style.

Yeah, all our tools do it.  We have a little shell on iOS that wraps each of our
tools and calls tool_main to run.  I don't think anyone actually uses it; this
is just to make buildbots happy.

Powered by Google App Engine
This is Rietveld 408576698