diff options
author | scroggo <scroggo@google.com> | 2015-10-15 07:51:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-15 07:51:28 -0700 |
commit | 860e8a67190e024b7375e52e270e6bd0a17af86e (patch) | |
tree | ba0cf7bf5b39a24ac426940c085e15c7822cef44 | |
parent | c603c143bb39e8a8dd1b35ad792c4dccb7de3a3a (diff) |
Renable image benchmarking
- Remove --images '' to renable image benchmarking
- Add a flag to disable testing JPEG's buildTileIndex, since it also leaks memory
- Do not run images on GPU
- Do not run large interlaced images on 32 bit bots
- When buildTileIndex is not being used in the subset benches, do not use it for BRD
BUG=skia:3418
BUG=skia:4469
BUG=skia:4471
BUG=skia:4360
Review URL: https://codereview.chromium.org/1396113002
-rw-r--r-- | bench/nanobench.cpp | 37 | ||||
-rw-r--r-- | tools/nanobench_flags.json | 17 | ||||
-rwxr-xr-x | tools/nanobench_flags.py | 15 |
3 files changed, 57 insertions, 12 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp index a48e963a9e..38f554dea4 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -112,6 +112,7 @@ DEFINE_int32(flushEvery, 10, "Flush --outResultsFile every Nth run."); DEFINE_bool(resetGpuContext, true, "Reset the GrContext before running each test."); DEFINE_bool(gpuStats, false, "Print GPU stats after each gpu benchmark?"); DEFINE_bool(pngBuildTileIndex, false, "If supported, use png buildTileIndex/decodeSubset."); +DEFINE_bool(jpgBuildTileIndex, false, "If supported, use jpg buildTileIndex/decodeSubset."); static SkString humanize(double ms) { if (FLAGS_verbose) return SkStringPrintf("%llu", (uint64_t)(ms*1e6)); @@ -513,9 +514,11 @@ static bool run_subset_bench(const SkString& path, bool useCodec) { "JPG", "JPEG", }; - for (uint32_t i = 0; i < SK_ARRAY_COUNT(exts); i++) { - if (path.endsWith(exts[i])) { - return true; + if (useCodec || FLAGS_jpgBuildTileIndex) { + for (uint32_t i = 0; i < SK_ARRAY_COUNT(exts); i++) { + if (path.endsWith(exts[i])) { + return true; + } } } @@ -983,12 +986,34 @@ public: while (fCurrentBRDStrategy < (int) SK_ARRAY_COUNT(strategies)) { fSourceType = "image"; fBenchType = strategies[fCurrentBRDStrategy].fName; + + const SkString& path = fImages[fCurrentBRDImage]; + const SkBitmapRegionDecoderInterface::Strategy strategy = + strategies[fCurrentBRDStrategy].fStrategy; + + if (SkBitmapRegionDecoderInterface::kOriginal_Strategy == strategy) { + // Disable png and jpeg for SkImageDecoder: + if (!FLAGS_jpgBuildTileIndex) { + if (path.endsWith("JPEG") || path.endsWith("JPG") || + path.endsWith("jpeg") || path.endsWith("jpg")) + { + fCurrentBRDStrategy++; + continue; + } + } + if (!FLAGS_pngBuildTileIndex) { + if (path.endsWith("PNG") || path.endsWith("png")) { + fCurrentBRDStrategy++; + continue; + } + } + } + while (fCurrentColorType < fColorTypes.count()) { while (fCurrentBRDSampleSize < (int) SK_ARRAY_COUNT(sampleSizes)) { while (fCurrentSubsetType <= kLastSingle_SubsetType) { - const SkString& path = fImages[fCurrentBRDImage]; - const SkBitmapRegionDecoderInterface::Strategy strategy = - strategies[fCurrentBRDStrategy].fStrategy; + + SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str())); const SkColorType colorType = fColorTypes[fCurrentColorType]; uint32_t sampleSize = sampleSizes[fCurrentBRDSampleSize]; diff --git a/tools/nanobench_flags.json b/tools/nanobench_flags.json index 4f669e1fe5..81649152b8 100644 --- a/tools/nanobench_flags.json +++ b/tools/nanobench_flags.json @@ -15,10 +15,12 @@ "~blurroundrect", "~patch_grid", "~desk_carsvg", - "~desk_unicodetable" + "~desk_unicodetable", + "~interlaced1.png", + "~interlaced2.png", + "~interlaced3.png" ], "Perf-Android-Nexus7-Tegra3-Arm7-Release": [ - "--images", "--scales", "1.0", "1.1", @@ -71,7 +73,11 @@ "--loops", "1", "--samples", - "1" + "1", + "--match", + "~interlaced1.png", + "~interlaced2.png", + "~interlaced3.png" ], "Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE": [ "--images", @@ -93,7 +99,10 @@ "256", "--match", "~gradient", - "~etc1bitmap" + "~etc1bitmap", + "~interlaced1.png", + "~interlaced2.png", + "~interlaced3.png" ], "Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Debug": [ "--images", diff --git a/tools/nanobench_flags.py b/tools/nanobench_flags.py index f590242686..471c1d92f8 100755 --- a/tools/nanobench_flags.py +++ b/tools/nanobench_flags.py @@ -29,8 +29,8 @@ cov_start = lineno()+1 # We care about coverage starting just past this def. def get_args(bot): args = [] - # Temporarily disable image benchmarking. - args.append('--images') + if 'GPU' in bot: + args.append('--images') if 'Appurify' not in bot: args.extend(['--scales', '1.0', '1.1']) @@ -80,6 +80,17 @@ def get_args(bot): match.append('~keymobi') match.append('~path_hairline') + # the 32-bit GCE bots run out of memory in DM when running these large images + # so defensively disable them in nanobench, too. + # FIXME (scroggo): This may have just been due to SkImageDecoder's + # buildTileIndex leaking memory (skbug.com/4360). That is disabled by + # default for nanobench, so we may not need this. + # FIXME (scroggo): Share image blacklists between dm and nanobench? + if 'x86' in bot and not 'x86-64' in bot: + match.append('~interlaced1.png') + match.append('~interlaced2.png') + match.append('~interlaced3.png') + if match: args.append('--match') args.extend(match) |