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

Side by Side Diff: bench/nanobench.cpp

Issue 483323002: Print max RSS in GM and nanobench too. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | dm/DMReporter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include <ctype.h> 8 #include <ctype.h>
9 9
10 #include "Benchmark.h" 10 #include "Benchmark.h"
11 #include "CrashHandler.h" 11 #include "CrashHandler.h"
12 #include "GMBench.h" 12 #include "GMBench.h"
13 #include "ProcStats.h"
13 #include "ResultsWriter.h" 14 #include "ResultsWriter.h"
14 #include "SKPBench.h" 15 #include "SKPBench.h"
15 #include "Stats.h" 16 #include "Stats.h"
16 #include "Timer.h" 17 #include "Timer.h"
17 18
18 #include "SkOSFile.h" 19 #include "SkOSFile.h"
19 #include "SkCanvas.h" 20 #include "SkCanvas.h"
20 #include "SkCommonFlags.h" 21 #include "SkCommonFlags.h"
21 #include "SkForceLinking.h" 22 #include "SkForceLinking.h"
22 #include "SkGraphics.h" 23 #include "SkGraphics.h"
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 573
573 SkAutoTMalloc<double> samples(FLAGS_samples); 574 SkAutoTMalloc<double> samples(FLAGS_samples);
574 575
575 if (kAutoTuneLoops != FLAGS_loops) { 576 if (kAutoTuneLoops != FLAGS_loops) {
576 SkDebugf("Fixed number of loops; times would only be misleading so we wo n't print them.\n"); 577 SkDebugf("Fixed number of loops; times would only be misleading so we wo n't print them.\n");
577 } else if (FLAGS_verbose) { 578 } else if (FLAGS_verbose) {
578 // No header. 579 // No header.
579 } else if (FLAGS_quiet) { 580 } else if (FLAGS_quiet) {
580 SkDebugf("median\tbench\tconfig\n"); 581 SkDebugf("median\tbench\tconfig\n");
581 } else { 582 } else {
582 SkDebugf("loops\tmin\tmedian\tmean\tmax\tstddev\tsamples\tconfig\tbench\ n"); 583 SkDebugf("maxrss\tloops\tmin\tmedian\tmean\tmax\tstddev\tsamples\tconfig \tbench\n");
583 } 584 }
584 585
585 SkTDArray<Config> configs; 586 SkTDArray<Config> configs;
586 create_configs(&configs); 587 create_configs(&configs);
587 588
588 BenchmarkStream benchStream; 589 BenchmarkStream benchStream;
589 while (Benchmark* b = benchStream.next()) { 590 while (Benchmark* b = benchStream.next()) {
590 SkAutoTDelete<Benchmark> bench(b); 591 SkAutoTDelete<Benchmark> bench(b);
591 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getName())) { 592 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getName())) {
592 continue; 593 continue;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 SkDebugf("%s ", HUMANIZE(samples[i])); 656 SkDebugf("%s ", HUMANIZE(samples[i]));
656 } 657 }
657 SkDebugf("%s\n", bench->getName()); 658 SkDebugf("%s\n", bench->getName());
658 } else if (FLAGS_quiet) { 659 } else if (FLAGS_quiet) {
659 if (targets.count() == 1) { 660 if (targets.count() == 1) {
660 config = ""; // Only print the config if we run the same ben ch on more than one. 661 config = ""; // Only print the config if we run the same ben ch on more than one.
661 } 662 }
662 SkDebugf("%s\t%s\t%s\n", HUMANIZE(stats.median), bench->getName( ), config); 663 SkDebugf("%s\t%s\t%s\n", HUMANIZE(stats.median), bench->getName( ), config);
663 } else { 664 } else {
664 const double stddev_percent = 100 * sqrt(stats.var) / stats.mean ; 665 const double stddev_percent = 100 * sqrt(stats.var) / stats.mean ;
665 SkDebugf("%d\t%s\t%s\t%s\t%s\t%.0f%%\t%s\t%s\t%s\n" 666 SkDebugf("%4dM\t%d\t%s\t%s\t%s\t%s\t%.0f%%\t%s\t%s\t%s\n"
667 , sk_tools::getMaxResidentSetSizeMB()
hal.canary 2014/08/19 21:35:59 Is it okay to print -1 here?
666 , loops 668 , loops
667 , HUMANIZE(stats.min) 669 , HUMANIZE(stats.min)
668 , HUMANIZE(stats.median) 670 , HUMANIZE(stats.median)
669 , HUMANIZE(stats.mean) 671 , HUMANIZE(stats.mean)
670 , HUMANIZE(stats.max) 672 , HUMANIZE(stats.max)
671 , stddev_percent 673 , stddev_percent
672 , stats.plot.c_str() 674 , stats.plot.c_str()
673 , config 675 , config
674 , bench->getName() 676 , bench->getName()
675 ); 677 );
(...skipping 13 matching lines...) Expand all
689 691
690 return 0; 692 return 0;
691 } 693 }
692 694
693 #if !defined SK_BUILD_FOR_IOS 695 #if !defined SK_BUILD_FOR_IOS
694 int main(int argc, char** argv) { 696 int main(int argc, char** argv) {
695 SkCommandLineFlags::Parse(argc, argv); 697 SkCommandLineFlags::Parse(argc, argv);
696 return nanobench_main(); 698 return nanobench_main();
697 } 699 }
698 #endif 700 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DMReporter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698