DM+nanobench: print both current and max RSS.
authormtklein <mtklein@chromium.org>
Thu, 30 Apr 2015 14:11:22 +0000 (07:11 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 30 Apr 2015 14:11:22 +0000 (07:11 -0700)
out/Debug/dm:
    ( 360/380 MB  2112) 396ms   gpu gm  xfermodes

out/Release/nanobench:
    32/33  MB 1659    2.46µs  2.55µs  2.54µs  2.67µs  2%  ▄▄▄▅▅▃▂▁▂█  gpu gradient_conicalZero_clamp_hicolor

out/Debug/nanobench:
    42/42  MB   desk_css3gradients.skp_1    8888

BUG=skia:

NOTREECHECKS=true

Review URL: https://codereview.chromium.org/1115203002

bench/nanobench.cpp
dm/DM.cpp
tools/ProcStats.h

index c33f2c77d2624d6e59a0a2e14848fd35d1b5ad52..85685fb3bccd52febb98fef804a86e2307f581cf 100644 (file)
@@ -137,7 +137,7 @@ struct GPUTarget : public Target {
     void fence() override {
         SK_GL(*this->gl, Finish());
     }
+
     bool needsFrameTiming() const override { return true; }
     bool init(SkImageInfo info, Benchmark* bench) override {
         uint32_t flags = this->config.useDFText ? SkSurfaceProps::kUseDistanceFieldFonts_Flag : 0;
@@ -166,7 +166,7 @@ struct GPUTarget : public Target {
         log->configOption("GL_SHADING_LANGUAGE_VERSION", (const char*) version);
     }
 };
-        
+
 #endif
 
 static double time(int loops, Benchmark* bench, Target* target) {
@@ -899,7 +899,7 @@ int nanobench_main() {
     } else if (FLAGS_quiet) {
         SkDebugf("median\tbench\tconfig\n");
     } else {
-        SkDebugf("maxrss\tloops\tmin\tmedian\tmean\tmax\tstddev\t%-*s\tconfig\tbench\n",
+        SkDebugf("curr/maxrss\tloops\tmin\tmedian\tmean\tmax\tstddev\t%-*s\tconfig\tbench\n",
                  FLAGS_samples, "samples");
     }
 
@@ -963,8 +963,9 @@ int nanobench_main() {
                 if (targets.count() == 1) {
                     config = ""; // Only print the config if we run the same bench on more than one.
                 }
-                SkDebugf("%4dM\t%s\t%s\n"
-                         , sk_tools::getBestResidentSetSizeMB()
+                SkDebugf("%4d/%-4dMB\t%s\t%s\n"
+                         , sk_tools::getCurrResidentSetSizeMB()
+                         , sk_tools::getMaxResidentSetSizeMB()
                          , bench->getUniqueName()
                          , config);
             } else if (FLAGS_verbose) {
@@ -979,8 +980,9 @@ int nanobench_main() {
                 SkDebugf("%s\t%s\t%s\n", HUMANIZE(stats.median), bench->getUniqueName(), config);
             } else {
                 const double stddev_percent = 100 * sqrt(stats.var) / stats.mean;
-                SkDebugf("%4dM\t%d\t%s\t%s\t%s\t%s\t%.0f%%\t%s\t%s\t%s\n"
-                        , sk_tools::getBestResidentSetSizeMB()
+                SkDebugf("%4d/%-4dMB\t%d\t%s\t%s\t%s\t%s\t%.0f%%\t%s\t%s\t%s\n"
+                        , sk_tools::getCurrResidentSetSizeMB()
+                        , sk_tools::getMaxResidentSetSizeMB()
                         , loops
                         , HUMANIZE(stats.min)
                         , HUMANIZE(stats.median)
index 3822431ae45f12c24dfe567b6993ed90eba412ed..006e208993bebc64f140382bb10389545ab20efe 100644 (file)
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -89,8 +89,9 @@ static void done(double ms,
         log.prepend("\n");
     }
     auto pending = sk_atomic_dec(&gPending)-1;
-    SkDebugf("%s(%4dMB %5d) %s\t%s%s%s", FLAGS_verbose ? "\n" : kSkOverwriteLine
-                                       , sk_tools::getBestResidentSetSizeMB()
+    SkDebugf("%s(%4d/%-4dMB %5d) %s\t%s%s%s", FLAGS_verbose ? "\n" : kSkOverwriteLine
+                                       , sk_tools::getCurrResidentSetSizeMB()
+                                       , sk_tools::getMaxResidentSetSizeMB()
                                        , pending
                                        , HumanizeMs(ms).c_str()
                                        , id.c_str()
index f085fe31a6ff532044928b32a04e567a1be6a5a8..344b304ba3d6335376ff82385499017dfa877af7 100644 (file)
@@ -26,16 +26,6 @@ int getMaxResidentSetSizeMB();
  */
 int getCurrResidentSetSizeMB();
 
-/**
- *  If implemented, returns getCurrResidentSetSizeMB().
- *  If not, if implemented, returns getMaxResidentSetSizeMB().
- *  If not, returns -1.
- */
-inline int getBestResidentSetSizeMB() {
-    int mb = getCurrResidentSetSizeMB();
-    return mb >= 0 ? mb : getMaxResidentSetSizeMB();
-}
-
 }  // namespace sk_tools
 
 #endif  // ProcStats_DEFINED