| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "BenchTimer.h" | 8 #include "BenchTimer.h" |
| 9 #include "ResultsWriter.h" | 9 #include "ResultsWriter.h" |
| 10 #include "SkBenchLogger.h" | 10 #include "SkBenchLogger.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 "picturerecord: draw from an SkPicture to an SkPicture.\n"); | 268 "picturerecord: draw from an SkPicture to an SkPicture.\n"); |
| 269 DEFINE_string(config, kDefaultsConfigStr, | 269 DEFINE_string(config, kDefaultsConfigStr, |
| 270 "Run configs given. By default, runs the configs marked \"runByDe
fault\" in gConfigs."); | 270 "Run configs given. By default, runs the configs marked \"runByDe
fault\" in gConfigs."); |
| 271 DEFINE_string(logFile, "", "Also write stdout here."); | 271 DEFINE_string(logFile, "", "Also write stdout here."); |
| 272 DEFINE_int32(minMs, 20, "Shortest time we'll allow a benchmark to run."); | 272 DEFINE_int32(minMs, 20, "Shortest time we'll allow a benchmark to run."); |
| 273 DEFINE_int32(maxMs, 4000, "Longest time we'll allow a benchmark to run."); | 273 DEFINE_int32(maxMs, 4000, "Longest time we'll allow a benchmark to run."); |
| 274 DEFINE_double(error, 0.01, | 274 DEFINE_double(error, 0.01, |
| 275 "Ratio of subsequent bench measurements must drop within 1±error t
o converge."); | 275 "Ratio of subsequent bench measurements must drop within 1±error t
o converge."); |
| 276 DEFINE_string(timeFormat, "%9.2f", "Format to print results, in milliseconds per
1000 loops."); | 276 DEFINE_string(timeFormat, "%9.2f", "Format to print results, in milliseconds per
1000 loops."); |
| 277 DEFINE_bool2(verbose, v, false, "Print more."); | 277 DEFINE_bool2(verbose, v, false, "Print more."); |
| 278 DEFINE_string2(resourcePath, i, NULL, "directory for test resources."); | 278 DEFINE_string2(resourcePath, i, "resources", "directory for test resources."); |
| 279 DEFINE_string(outResultsFile, "", "If given, the results will be written to the
file in JSON format."); | 279 DEFINE_string(outResultsFile, "", "If given, the results will be written to the
file in JSON format."); |
| 280 | 280 |
| 281 // Has this bench converged? First arguments are milliseconds / loop iteration, | 281 // Has this bench converged? First arguments are milliseconds / loop iteration, |
| 282 // last is overall runtime in milliseconds. | 282 // last is overall runtime in milliseconds. |
| 283 static bool HasConverged(double prevPerLoop, double currPerLoop, double currRaw)
{ | 283 static bool HasConverged(double prevPerLoop, double currPerLoop, double currRaw)
{ |
| 284 if (currRaw < FLAGS_minMs) { | 284 if (currRaw < FLAGS_minMs) { |
| 285 return false; | 285 return false; |
| 286 } | 286 } |
| 287 const double low = 1 - FLAGS_error, high = 1 + FLAGS_error; | 287 const double low = 1 - FLAGS_error, high = 1 + FLAGS_error; |
| 288 const double ratio = currPerLoop / prevPerLoop; | 288 const double ratio = currPerLoop / prevPerLoop; |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 gContextFactory.destroyContexts(); | 687 gContextFactory.destroyContexts(); |
| 688 #endif | 688 #endif |
| 689 return 0; | 689 return 0; |
| 690 } | 690 } |
| 691 | 691 |
| 692 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 692 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 693 int main(int argc, char * const argv[]) { | 693 int main(int argc, char * const argv[]) { |
| 694 return tool_main(argc, (char**) argv); | 694 return tool_main(argc, (char**) argv); |
| 695 } | 695 } |
| 696 #endif | 696 #endif |
| OLD | NEW |