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

Unified Diff: bench/nanobench.cpp

Issue 773323002: Upload picture byte size and op count metrics for SKP recording. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | « bench/ResultsWriter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index b7603bf3bcd1925ad30bf7ba05cbdfc229372d67..7088312146c1f9c25b8f309fd0043584c78529f2 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -24,6 +24,7 @@
#include "SkGraphics.h"
#include "SkOSFile.h"
#include "SkPictureRecorder.h"
+#include "SkPictureUtils.h"
#include "SkString.h"
#include "SkSurface.h"
#include "SkTaskGroup.h"
@@ -524,6 +525,8 @@ public:
SkString name = SkOSPath::Basename(path.c_str());
fSourceType = "skp";
fBenchType = "recording";
+ fSKPBytes = SkPictureUtils::ApproximateBytesUsed(pic);
+ fSKPOps = pic->approximateOpCount();
return SkNEW_ARGS(RecordingBench, (name.c_str(), pic.get(), FLAGS_bbh));
}
@@ -578,6 +581,10 @@ public:
log->configOption("multi_picture_draw", fUseMPDs[fCurrentUseMPD-1] ? "true" : "false");
}
}
+ if (0 == strcmp(fBenchType, "recording")) {
+ log->metric("bytes", fSKPBytes);
+ log->metric("ops", fSKPOps);
+ }
}
private:
@@ -588,6 +595,8 @@ private:
SkTArray<SkString> fSKPs;
SkTArray<bool> fUseMPDs;
+ double fSKPBytes, fSKPOps;
+
const char* fSourceType; // What we're benching: bench, GM, SKP, ...
const char* fBenchType; // How we bench it: micro, recording, playback, ...
int fCurrentRecording;
@@ -724,11 +733,11 @@ int nanobench_main() {
fill_gpu_options(log.get(), targets[j]->gl);
}
#endif
- log->timer("min_ms", stats.min);
- log->timer("median_ms", stats.median);
- log->timer("mean_ms", stats.mean);
- log->timer("max_ms", stats.max);
- log->timer("stddev_ms", sqrt(stats.var));
+ log->metric("min_ms", stats.min);
+ log->metric("median_ms", stats.median);
+ log->metric("mean_ms", stats.mean);
+ log->metric("max_ms", stats.max);
+ log->metric("stddev_ms", sqrt(stats.var));
if (runs++ % FLAGS_flushEvery == 0) {
log->flush();
}
« no previous file with comments | « bench/ResultsWriter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698