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 187643002: Remove unused TimerData that generates errors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 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 8f445d82c2a49f5ce9d7c279a2be07b14adf292b..74caa0375531669548bab8f8f60d524e739b2f39 100644
--- a/tools/bbh_shootout.cpp
+++ b/tools/bbh_shootout.cpp
@@ -301,13 +301,12 @@ static void benchmark_recording(
* As a side effect, it spits the timer result to stdout.
* Will return -1.0 on error.
*/
-static bool benchmark_loop(
+static void benchmark_loop(
int argc,
char **argv,
const BenchmarkControl& benchControl,
SkTArray<Histogram>& histogram) {
static const SkString timeFormat("%f");
mtklein 2014/03/05 15:04:53 Now unused?
iancottrell 2014/03/05 15:41:11 Done.
- TimerData timerData(argc - 1);
for (int index = 1; index < argc; ++index) {
BenchTimer timer;
SkString path(argv[index]);
@@ -317,30 +316,9 @@ static bool benchmark_loop(
continue;
}
benchControl.fFunction(benchControl, path, pic, &timer);
-
histogram[index - 1].fPath = path;
histogram[index - 1].fCpuTime = SkDoubleToScalar(timer.fCpu);
}
-
- const SkString timerResult = timerData.getResult(
- /*doubleFormat = */ timeFormat.c_str(),
- /*result = */ TimerData::kAvg_Result,
- /*configName = */ benchControl.fName.c_str(),
- /*timerFlags = */ TimerData::kCpu_Flag);
-
- const char findStr[] = "= ";
- int pos = timerResult.find(findStr);
- if (-1 == pos) {
- SkDebugf("Unexpected output from TimerData::getResult(...). Unable to parse.\n");
- return false;
- }
-
- SkScalar cpuTime = SkDoubleToScalar(atof(timerResult.c_str() + pos + sizeof(findStr) - 1));
- if (cpuTime == 0) { // atof returns 0.0 on error.
- SkDebugf("Unable to read value from timer result.\n");
- return false;
- }
- return true;
}
int tool_main(int argc, char** argv);
@@ -358,13 +336,10 @@ int tool_main(int argc, char** argv) {
for (size_t i = 0; i < kNumBenchmarks; ++i) {
histograms[i].reset(argc - 1);
- bool success = benchmark_loop(
+ benchmark_loop(
argc, argv,
mtklein 2014/03/05 15:04:53 Funky alignment now.
iancottrell 2014/03/05 15:41:11 Done.
BenchmarkControl::Make(i),
histograms[i]);
- if (!success) {
- SkDebugf("benchmark_loop failed at index %d\n", i);
- }
}
// Output gnuplot readable histogram data..
« 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