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

Unified Diff: tools/bbh_shootout.cpp

Issue 23639003: bbh_shootout: Move bitmap rendering out of the timing codepath. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bbh_shootout.cpp
diff --git a/tools/bbh_shootout.cpp b/tools/bbh_shootout.cpp
index 76e8d074c3f78a37c82a67dd70325c913aa714ed..88223898f8b51b88519f1b0a00262cb1bdce9cdc 100644
--- a/tools/bbh_shootout.cpp
+++ b/tools/bbh_shootout.cpp
@@ -238,11 +238,11 @@ static void do_benchmark_work(sk_tools::PictureRenderer* renderer,
}
renderer->setup();
- // Render once to fill caches.
- renderer->render(NULL);
+ // Render once to fill caches. Fill bitmap during the first iteration.
+ renderer->render(NULL, out);
// Render again to measure
timer->start();
- bool result = renderer->render(NULL, out);
+ bool result = renderer->render(NULL);
timer->end();
// We only care about a false result on playback. RecordPictureRenderer::render will always
@@ -388,7 +388,9 @@ int tool_main(int argc, char** argv) {
playbackOut.writeText("\n");
// Write to file, and save recording averages.
SkScalar avgRecord = SkIntToScalar(0);
+ SkScalar avgPlayback = SkIntToScalar(0);
SkScalar avgRecordRTree = SkIntToScalar(0);
+ SkScalar avgPlaybackRTree = SkIntToScalar(0);
for (int i = 0; i < argc - 1; ++i) {
SkString pbLine;
SkString recLine;
@@ -400,10 +402,13 @@ int tool_main(int argc, char** argv) {
cpuTime = histograms[BenchmarkControl::kRTreeRecord][i].fCpuTime;
recLine.appendf("%f", cpuTime);
avgRecordRTree += cpuTime;
+ avgPlaybackRTree += cpuTime;
// ==== Write playback info
pbLine.printf("%d ", i);
pbLine.appendf("%f ", histograms[2][i].fCpuTime); // Start with normal playback time.
+ avgPlayback += histograms[kNumBbhPlaybackBenchmarks - 1][i].fCpuTime;
+ avgPlaybackRTree += histograms[kNumBbhPlaybackBenchmarks][i].fCpuTime;
// Append all playback benchmark times.
for (size_t j = kNumBbhPlaybackBenchmarks; j < kNumBenchmarks; ++j) {
pbLine.appendf("%f ", histograms[j][i].fCpuTime);
@@ -416,8 +421,13 @@ int tool_main(int argc, char** argv) {
}
avgRecord /= argc - 1;
avgRecordRTree /= argc - 1;
+ avgPlayback /= argc - 1;
+ avgPlaybackRTree /= argc - 1;
SkDebugf("Average base recording time: %.3fms\n", avgRecord);
SkDebugf("Average recording time with rtree: %.3fms\n", avgRecordRTree);
+ SkDebugf("Average base playback time: %.3fms\n", avgPlayback);
+ SkDebugf("Average playback time with rtree: %.3fms\n", avgPlaybackRTree);
+
SkDebugf("\nWrote data to gnuplot-readable files: %s %s\n", pbTitle, recTitle);
return 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698