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

Unified Diff: tools/bbh_shootout.cpp

Issue 19862002: Do timer allocation and string building outside of bench loops (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: on top of tot Created 7 years, 5 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 | « tools/PictureBenchmark.cpp ('k') | tools/bench_pictures_main.cpp » ('j') | 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 24d7b865006e484e82e5bc5a68fbfad8c2e79926..9de0bfcf828ab91a493307d2173beb9bfbdeb085 100644
--- a/tools/bbh_shootout.cpp
+++ b/tools/bbh_shootout.cpp
@@ -268,7 +268,7 @@ static bool benchmark_loop(
const BenchmarkControl& benchControl,
SkTArray<Histogram>& histogram) {
static const SkString timeFormat("%f");
- TimerData timerData(timeFormat, timeFormat);
+ TimerData timerData(argc - 1);
for (int index = 1; index < argc; ++index) {
BenchTimer timer;
SkString path(argv[index]);
@@ -278,22 +278,17 @@ static bool benchmark_loop(
continue;
}
benchControl.fFunction(benchControl.fType, benchControl.fTileSize, path, pic, &timer);
- timerData.appendTimes(&timer, argc - 1 == index);
+ SkAssertResult(timerData.appendTimes(&timer));
histogram[index - 1].fPath = path;
histogram[index - 1].fCpuTime = SkDoubleToScalar(timer.fCpu);
}
const SkString timerResult = timerData.getResult(
- /*logPerIter = */ false,
- /*printMin = */ false,
- /*repeatDraw = */ 1,
+ /*doubleFormat = */ timeFormat.c_str(),
+ /*result = */ TimerData::kAvg_Result,
/*configName = */ benchControl.fName.c_str(),
- /*showWallTime = */ false,
- /*showTruncatedWallTime = */ false,
- /*showCpuTime = */ true,
- /*showTruncatedCpuTime = */ false,
- /*showGpuTime = */ false);
+ /*timerFlags = */ TimerData::kCpu_Flag);
const char findStr[] = "= ";
int pos = timerResult.find(findStr);
« no previous file with comments | « tools/PictureBenchmark.cpp ('k') | tools/bench_pictures_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698