|
|
DescriptionMake nanobench setup configs outside of loop over benchmarks
Committed: https://skia.googlesource.com/skia/+/c2553373ee982b6c7c753e7e5035523bc01a7291
Patch Set 1 #
Total comments: 12
Patch Set 2 : Address comments #Patch Set 3 : cleanup #
Total comments: 2
Patch Set 4 : Add bogus ctx type to init list for cpu configs #Messages
Total messages: 15 (0 generated)
just nits https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp File bench/nanobench.cpp (right): https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp#newcode216 bench/nanobench.cpp:216: const Config* config; // unowned or perhaps this? struct Target { explicit Target(const Config& config) : config(config) {} const Config& config; SkAutoTDelete<SkSurface> surface; ... } https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp#newcode234 bench/nanobench.cpp:234: int sampleCnt) { funky alignment here https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp#newcode284 bench/nanobench.cpp:284: // If bench is enabled for backend/config, returns a Target* for them, otherwise NULL. ... is enabled for config, returns a Target* for it, otherwise NULL. https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp#newcode285 bench/nanobench.cpp:285: static Target* is_enabled(Benchmark* bench, const Config* config) { const Config& ? https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp#newcode296 bench/nanobench.cpp:296: info.fWidth = w; just inline bench->getSize().fX and bench->getSize().fY here? https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp#newcode302 bench/nanobench.cpp:302: SkAutoTUnref<SkSurface> surface; Why go through the extra pointer? if (Benchmark::kRaster_Backend == config->backend) { target->surface.reset(SkSurface::NewRaster(info)); } ... if (!target->surface && Benchmark::kNonRenderingBackend != config->backend) { ... }
https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp File bench/nanobench.cpp (right): https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp#newcode216 bench/nanobench.cpp:216: const Config* config; On 2014/07/22 17:44:19, mtklein wrote: > // unowned > > or perhaps this? > > struct Target { > explicit Target(const Config& config) : config(config) {} > > const Config& config; > SkAutoTDelete<SkSurface> surface; > ... > } Done, but makes a copy of config (seems harmless). https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp#newcode234 bench/nanobench.cpp:234: int sampleCnt) { On 2014/07/22 17:44:19, mtklein wrote: > funky alignment here Done. https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp#newcode284 bench/nanobench.cpp:284: // If bench is enabled for backend/config, returns a Target* for them, otherwise NULL. On 2014/07/22 17:44:19, mtklein wrote: > ... is enabled for config, returns a Target* for it, otherwise NULL. Done. https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp#newcode285 bench/nanobench.cpp:285: static Target* is_enabled(Benchmark* bench, const Config* config) { On 2014/07/22 17:44:19, mtklein wrote: > const Config& ? Done. https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp#newcode296 bench/nanobench.cpp:296: info.fWidth = w; On 2014/07/22 17:44:19, mtklein wrote: > just inline bench->getSize().fX and bench->getSize().fY here? Done. https://codereview.chromium.org/410683005/diff/1/bench/nanobench.cpp#newcode302 bench/nanobench.cpp:302: SkAutoTUnref<SkSurface> surface; On 2014/07/22 17:44:19, mtklein wrote: > Why go through the extra pointer? > > if (Benchmark::kRaster_Backend == config->backend) { > target->surface.reset(SkSurface::NewRaster(info)); > } > ... > > if (!target->surface && Benchmark::kNonRenderingBackend != config->backend) { > ... > } Done.
lgtm https://codereview.chromium.org/410683005/diff/40001/bench/nanobench.cpp File bench/nanobench.cpp (right): https://codereview.chromium.org/410683005/diff/40001/bench/nanobench.cpp#newc... bench/nanobench.cpp:217: const Config config; No copy if you hold this as const Config& config.
The CQ bit was checked by bsalomon@google.com
https://codereview.chromium.org/410683005/diff/40001/bench/nanobench.cpp File bench/nanobench.cpp (right): https://codereview.chromium.org/410683005/diff/40001/bench/nanobench.cpp#newc... bench/nanobench.cpp:217: const Config config; On 2014/07/22 18:16:17, mtklein wrote: > No copy if you hold this as const Config& config. I know but the copy seems harmless and less prone to any future lifetime errors.
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/bsalomon@google.com/410683005/40001
On 2014/07/22 18:40:01, bsalomon wrote: > https://codereview.chromium.org/410683005/diff/40001/bench/nanobench.cpp > File bench/nanobench.cpp (right): > > https://codereview.chromium.org/410683005/diff/40001/bench/nanobench.cpp#newc... > bench/nanobench.cpp:217: const Config config; > On 2014/07/22 18:16:17, mtklein wrote: > > No copy if you hold this as const Config& config. > > I know but the copy seems harmless and less prone to any future lifetime errors. Oh, agreed. Just wanted to point this out, as a const& both identical cost and identical lifetime issues of the const* you had at first.
On 2014/07/22 18:44:02, mtklein wrote: > On 2014/07/22 18:40:01, bsalomon wrote: > > https://codereview.chromium.org/410683005/diff/40001/bench/nanobench.cpp > > File bench/nanobench.cpp (right): > > > > > https://codereview.chromium.org/410683005/diff/40001/bench/nanobench.cpp#newc... > > bench/nanobench.cpp:217: const Config config; > > On 2014/07/22 18:16:17, mtklein wrote: > > > No copy if you hold this as const Config& config. > > > > I know but the copy seems harmless and less prone to any future lifetime > errors. > > Oh, agreed. Just wanted to point this out, as a const& both identical cost and > identical lifetime issues of the const* you had at first. ...const& *has* both identical...
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: Build-Mac10.8-Clang-x86-Release-Trybot on tryserver.skia (http://108.170.220.76:10117/builders/Build-Mac10.8-Clang-x86-Release-Trybot/b...) Build-Ubuntu13.10-Clang-x86_64-Debug-Trybot on tryserver.skia (http://108.170.220.76:10117/builders/Build-Ubuntu13.10-Clang-x86_64-Debug-Try...) Build-Ubuntu13.10-GCC4.8-Arm7-Debug-Android-Trybot on tryserver.skia (http://108.170.220.76:10117/builders/Build-Ubuntu13.10-GCC4.8-Arm7-Debug-Andr...) Build-Ubuntu13.10-GCC4.8-x86_64-Release-Trybot on tryserver.skia (http://108.170.220.76:10117/builders/Build-Ubuntu13.10-GCC4.8-x86_64-Release-...)
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: Build-Ubuntu13.10-GCC4.8-Arm7-Debug-Android-Trybot on tryserver.skia (http://108.170.220.76:10117/builders/Build-Ubuntu13.10-GCC4.8-Arm7-Debug-Andr...)
The CQ bit was checked by bsalomon@google.com
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/bsalomon@google.com/410683005/60001
Message was sent while issue was closed.
Change committed as c2553373ee982b6c7c753e7e5035523bc01a7291 |