Lines Matching defs:bench

10 #include "bench/nanobench.h"
12 #include "bench/AndroidCodecBench.h"
13 #include "bench/Benchmark.h"
14 #include "bench/CodecBench.h"
15 #include "bench/CodecBenchPriv.h"
16 #include "bench/GMBench.h"
17 #include "bench/MSKPBench.h"
18 #include "bench/RecordingBench.h"
19 #include "bench/ResultsWriter.h"
20 #include "bench/SKPAnimationBench.h"
21 #include "bench/SKPBench.h"
22 #include "bench/SkGlyphCacheBench.h"
23 #include "bench/SkSLBench.h"
60 #include "bench/BitmapRegionDecoderBench.h"
96 help.printf("Number of times to run each bench. Set this to %d to auto-"
97 "tune for each bench. Timings are only reported when auto-tuning.",
110 static DEFINE_int(samples, 10, "Number of samples to measure for each bench.");
111 static DEFINE_int(ms, 0, "If >0, run each bench for this many ms instead of obeying --samples.");
115 static DEFINE_double(gpuMs, 5, "Target bench time in millseconds for GPU.");
121 "Try up to this many times to guess loops for a bench, or skip the bench.");
122 static DEFINE_int(maxLoops, 1000000, "Never run a bench more times than this.");
137 "Apply usual --match rules to source type: bench, gm, skp, image, etc.");
139 "Apply usual --match rules to bench type: micro, recording, "
202 bool Target::init(SkImageInfo info, Benchmark* bench) {
255 bool init(SkImageInfo info, Benchmark* bench) override {
257 bench->modifyGrContextOptions(&options);
284 static double time(int loops, Benchmark* bench, Target* target) {
289 bench->preDraw(canvas);
292 bench->draw(loops, canvas);
295 bench->postDraw(canvas);
319 "There's probably something wrong with the bench.\n", loops);
363 static int setup_cpu_bench(const double overhead, Target* target, Benchmark* bench) {
364 // First figure out approximately how many loops of bench it takes to make overhead negligible.
367 int loops = bench->calculateLoops(FLAGS_loops);
372 bench->getUniqueName(), HUMANIZE(bench_plus_overhead), HUMANIZE(overhead));
375 bench_plus_overhead = time(1, bench, target);
407 static int setup_gpu_bench(Target* target, Benchmark* bench, int maxGpuFrameLag) {
409 int loops = bench->calculateLoops(FLAGS_loops);
415 // We're about to wrap. Something's wrong with the bench.
423 elapsed = time(loops, bench, target);
439 time(loops, bench, target);
549 // If bench is enabled for config, returns a Target* for it, otherwise nullptr.
550 static Target* is_enabled(Benchmark* bench, const Config& config) {
551 if (!bench->isSuitableFor(config.backend)) {
555 SkImageInfo info = SkImageInfo::Make(bench->getSize().fX, bench->getSize().fY,
569 if (!target->init(info, bench)) {
730 std::unique_ptr<Benchmark> bench;
732 bench.reset(this->rawNext());
733 if (!bench) {
738 return bench.release();
743 Benchmark* bench = fBenches->get()(nullptr);
745 fSourceType = "bench";
747 return bench;
1122 const char* fSourceType; // What we're benching: bench, GM, SKP, ...
1123 const char* fBenchType; // How we bench it: micro, recording, playback, ...
1270 std::unique_ptr<Benchmark> bench(b);
1271 if (CommandLineFlags::ShouldSkip(FLAGS_match, bench->getUniqueName())) {
1276 log.beginBench(bench->getUniqueName(), bench->getSize().fX, bench->getSize().fY);
1277 bench->delayedSetup();
1291 , bench->getUniqueName()
1302 TRACE_EVENT2("skia", "Benchmark", "name", TRACE_STR_COPY(bench->getUniqueName()),
1306 bench->perCanvasPreDraw(canvas);
1310 ? setup_gpu_bench(target, bench.get(), maxFrameLag)
1311 : setup_cpu_bench(overhead, target, bench.get());
1320 // Run the first bench for 1000ms to warm up the nanobench if FLAGS_ms < 1000.
1324 time(loops, bench.get(), target);
1333 samples.push_back(time(loops, bench.get(), target) / loops);
1339 samples[s] = time(loops, bench.get(), target) / loops;
1346 sample *= (1.0 / bench->getUnits());
1354 bench->getGpuStats(canvas, &keys, &values);
1356 if (FLAGS_dmsaaStatsDump && bench->getDMSAAStats(canvas->recordingContext())) {
1364 bench->perCanvasPostDraw(canvas);
1369 pngFilename = SkOSPath::Join(pngFilename.c_str(), bench->getUniqueName());
1382 log.appendString("name", bench->getName());
1411 config = ""; // Only print the config if we run the same bench on more than one.
1416 , bench->getUniqueName()
1426 stats.median*1e3, mark, bench->getUniqueName(), config);
1437 , bench->getUniqueName()
1454 , bench->getUniqueName()
1467 SkDebugf("%s\n", bench->getUniqueName());