Home | History | Annotate | Download | only in bench

Lines Matching refs:bench

77     help.printf("Number of times to run each bench. Set this to %d to auto-"
78 "tune for each bench. Timings are only reported when auto-tuning.",
91 DEFINE_int32(samples, 10, "Number of samples to measure for each bench.");
92 DEFINE_int32(ms, 0, "If >0, run each bench for this many ms instead of obeying --samples.");
96 DEFINE_double(gpuMs, 5, "Target bench time in millseconds for GPU.");
103 "Try up to this many times to guess loops for a bench, or skip the bench.");
104 DEFINE_int32(maxLoops, 1000000, "Never run a bench more times than this.");
121 "Apply usual --match rules to source type: bench, gm, skp, image, etc.");
123 "Apply usual --match rules to bench type: micro, recording, playback, skcodec, etc.");
133 bool Target::init(SkImageInfo info, Benchmark* bench) {
182 bool init(SkImageInfo info, Benchmark* bench) override {
219 static double time(int loops, Benchmark* bench, Target* target) {
224 bench->preDraw(canvas);
227 bench->draw(loops, canvas);
233 bench->postDraw(canvas);
257 "There's probably something wrong with the bench.\n", loops);
301 static int setup_cpu_bench(const double overhead, Target* target, Benchmark* bench) {
302 // First figure out approximately how many loops of bench it takes to make overhead negligible.
305 int loops = bench->calculateLoops(FLAGS_loops);
310 bench->getUniqueName(), HUMANIZE(bench_plus_overhead), HUMANIZE(overhead));
313 bench_plus_overhead = time(1, bench, target);
322 // overhead + N * Bench Time
324 // where bench_plus_overhead ? overhead + Bench Time.
345 static int setup_gpu_bench(Target* target, Benchmark* bench, int maxGpuFrameLag) {
347 int loops = bench->calculateLoops(FLAGS_loops);
353 // We're about to wrap. Something's wrong with the bench.
361 elapsed = time(loops, bench, target);
378 time(loops, bench, target);
467 // If bench is enabled for config, returns a Target* for it, otherwise nullptr.
468 static Target* is_enabled(Benchmark* bench, const Config& config) {
469 if (!bench->isSuitableFor(config.backend)) {
473 SkImageInfo info = SkImageInfo::Make(bench->getSize().fX, bench->getSize().fY,
486 target = new HWUITarget(config, bench);
494 if (!target->init(info, bench)) {
631 SkAutoTDelete<Benchmark> bench;
633 bench.reset(this->rawNext());
634 if (!bench) {
639 return bench.detach();
644 Benchmark* bench = fBenches->factory()(nullptr);
646 fSourceType = "bench";
648 return bench;
982 const char* fSourceType; // What we're benching: bench, GM, SKP, ...
983 const char* fBenchType; // How we bench it: micro, recording, playback, ...
1111 SkAutoTDelete<Benchmark> bench(b);
1112 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getUniqueName())) {
1117 log->bench(bench->getUniqueName(), bench->getSize().fX, bench->getSize().fY);
1118 bench->delayedSetup();
1137 , bench->getUniqueName()
1145 bench->perCanvasPreDraw(canvas);
1149 ? setup_gpu_bench(target, bench.get(), maxFrameLag)
1150 : setup_cpu_bench(overhead, target, bench.get());
1156 samples.push_back(time(loops, bench, target) / loops);
1161 samples[s] = time(loops, bench, target) / loops;
1171 bench->getGpuStats(canvas, &keys, &values);
1175 bench->perCanvasPostDraw(canvas);
1180 pngFilename = SkOSPath::Join(pngFilename.c_str(), bench->getUniqueName());
1193 log->configOption("name", bench->getName());
1214 config = ""; // Only print the config if we run the same bench on more than one.
1219 , bench->getUniqueName()
1228 stats.median*1e3, mark, bench->getUniqueName(), config);
1242 , bench->getUniqueName()
1260 SkDebugf("%s\n", bench->getUniqueName());
1266 log->bench("memory_usage", 0,0);