OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |