skia2/bench
mtklein 7e225bdb1f nanobench: lazily decode bitmaps in .skps.
This cuts down on tool overhead when running something like recording only,
    $ out/Release/nanobench --match skp --config nonrendering
which doesn't usually ever need to decode the images.

The actual measurements for recording don't change, as the decode is not in the timed section.  It just skips irrelevant code, removing it from the profile and making the tool run faster.

This does, however, make a significant difference for playback speed.  Most skps draw faster with this patch, some slower.  I don't really have a good intuition for what's going on here.  There is a fixed clip acting as a viewport, so there are probably lots of images that don't ever need to be decoded.  Ideas?  Is this perhaps because we're now blitting from smaller, partially decoded source images?

~/skia (clean) $ compare clean.log lazy-decode-bitmaps.log
                   tabl_slashdot.skp_1	2.76ms -> 4.33ms	1.57x
               tabl_slashdot.skp_1_mpd	2.79ms -> 4.07ms	1.46x
                    tabl_sahadan.skp_1	3.41ms -> 4.87ms	1.43x
                 tabl_googleblog.skp_1	1.52ms -> 2.05ms	1.35x
               tabl_techmeme.skp_1_mpd	1.14ms -> 1.51ms	1.32x
               tabl_transformice.skp_1	2.61ms -> 3.43ms	1.31x
                tabl_sahadan.skp_1_mpd	3.54ms -> 4.48ms	1.26x
                   tabl_techmeme.skp_1	1.01ms -> 1.27ms	1.26x
                tabl_nytimes.skp_1_mpd	   1ms -> 1.23ms	1.23x
           tabl_worldjournal.skp_1_mpd	1.98ms -> 2.43ms	1.23x
                 tabl_pravda.skp_1_mpd	2.05ms -> 2.51ms	1.22x
           tabl_transformice.skp_1_mpd	2.75ms -> 3.19ms	1.16x
                    tabl_nytimes.skp_1	 874us -> 1.01ms	1.15x
                     tabl_pravda.skp_1	1.83ms -> 1.99ms	1.09x
               tabl_worldjournal.skp_1	1.76ms -> 1.91ms	1.09x
                desk_wowwiki.skp_1_mpd	 3.7ms ->  3.9ms	1.05x
                       tabl_digg.skp_1	3.99ms -> 4.16ms	1.04x
                  tabl_ukwsj.skp_1_mpd	   3ms -> 3.12ms	1.04x
                    desk_booking.skp_1	3.74ms -> 3.81ms	1.02x
    desk_googlespreadsheetdashed.skp_1	10.6ms -> 10.6ms	1x
                      tabl_ukwsj.skp_1	2.88ms -> 2.89ms	1x
desk_googlespreadsheetdashed.skp_1_mpd	11.8ms -> 11.8ms	1x
     desk_jsfiddlehumperclip.skp_1_mpd	 891us ->  888us	1x
          desk_googlespreadsheet.skp_1	4.65ms -> 4.62ms	0.99x
                  tabl_gspro.skp_1_mpd	1.97ms -> 1.94ms	0.99x
                desk_booking.skp_1_mpd	 4.1ms ->    4ms	0.98x
                     desk_carsvg.skp_1	18.2ms -> 17.7ms	0.97x
            desk_gmailthread.skp_1_mpd	2.81ms -> 2.73ms	0.97x
               desk_tigersvg.skp_1_mpd	19.5ms -> 18.9ms	0.97x
                     desk_mapsvg.skp_1	88.4ms -> 85.6ms	0.97x
                   tabl_cnet.skp_1_mpd	1.43ms -> 1.38ms	0.97x
             desk_jsfiddlebigcar.skp_1	1.26ms -> 1.22ms	0.96x
                        desk_gws.skp_1	1.87ms ->  1.8ms	0.96x
                   desk_linkedin.skp_1	2.07ms -> 1.98ms	0.96x
             tabl_deviantart.skp_1_mpd	 118ms ->  113ms	0.96x
                       tabl_cnet.skp_1	 1.2ms -> 1.14ms	0.95x
          tabl_androidpolice.skp_1_mpd	5.95ms -> 5.63ms	0.95x
                     desk_sfgate.skp_1	1.75ms -> 1.64ms	0.94x
                    desk_twitter.skp_1	  74ms -> 69.6ms	0.94x
                desk_youtube.skp_1_mpd	3.17ms -> 2.96ms	0.93x
                desk_gmailthread.skp_1	2.73ms -> 2.54ms	0.93x
            desk_silkfinance.skp_1_mpd	1.71ms -> 1.59ms	0.93x
         desk_jsfiddlebigcar.skp_1_mpd	1.45ms -> 1.35ms	0.93x
            desk_pokemonwiki.skp_1_mpd	2.72ms -> 2.51ms	0.92x
                    desk_gws.skp_1_mpd	2.14ms -> 1.98ms	0.92x
                 desk_googlehome.skp_1	 563us ->  517us	0.92x
                       desk_espn.skp_1	4.24ms -> 3.89ms	0.92x
          tabl_culturalsolutions.skp_1	12.7ms -> 11.6ms	0.91x
                 desk_sfgate.skp_1_mpd	1.91ms -> 1.74ms	0.91x
                       tabl_hsfi.skp_1	1.06ms ->  966us	0.91x
               desk_samoasvg.skp_1_mpd	10.5ms -> 9.47ms	0.91x
               desk_facebook.skp_1_mpd	 3.8ms -> 3.43ms	0.9x
                    desk_youtube.skp_1	3.52ms -> 3.14ms	0.89x
                   desk_ebay.skp_1_mpd	2.95ms -> 2.62ms	0.89x
                   desk_samoasvg.skp_1	10.9ms -> 9.66ms	0.89x
      desk_googlespreadsheet.skp_1_mpd	5.59ms -> 4.94ms	0.88x
                 desk_mapsvg.skp_1_mpd	 100ms -> 87.9ms	0.88x
                   desk_espn.skp_1_mpd	 4.7ms -> 4.12ms	0.88x
              desk_wordpress.skp_1_mpd	1.92ms -> 1.68ms	0.87x
                 tabl_deviantart.skp_1	 140ms ->  122ms	0.87x
           tabl_cuteoverload.skp_1_mpd	4.41ms -> 3.83ms	0.87x
                   desk_tigersvg.skp_1	19.6ms ->   17ms	0.87x
             tabl_googlecalendar.skp_1	4.01ms -> 3.44ms	0.86x
                    desk_blogger.skp_1	2.49ms -> 2.14ms	0.86x
             desk_chalkboard.skp_1_mpd	52.7ms ->   45ms	0.85x
                    desk_weather.skp_1	2.88ms -> 2.46ms	0.85x
                 desk_chalkboard.skp_1	  51ms -> 43.4ms	0.85x
               desk_yahooanswers.skp_1	2.74ms -> 2.32ms	0.85x
             desk_forecastio.skp_1_mpd	1.26ms -> 1.07ms	0.85x
              tabl_androidpolice.skp_1	5.18ms -> 4.34ms	0.84x
           desk_yahooanswers.skp_1_mpd	3.44ms -> 2.85ms	0.83x
                    tabl_cnn.skp_1_mpd	2.59ms -> 2.15ms	0.83x
                  desk_pinterest.skp_1	2.69ms -> 2.22ms	0.83x
                   tabl_hsfi.skp_1_mpd	 1.6ms -> 1.32ms	0.82x
      tabl_culturalsolutions.skp_1_mpd	13.8ms -> 11.3ms	0.82x
                desk_twitter.skp_1_mpd	76.6ms ->   63ms	0.82x
                       desk_ebay.skp_1	3.11ms -> 2.51ms	0.81x
                    tabl_mlb.skp_1_mpd	3.17ms -> 2.53ms	0.8x
                    tabl_mozilla.skp_1	2.42ms -> 1.91ms	0.79x
                desk_pokemonwiki.skp_1	2.84ms -> 2.22ms	0.78x
                 desk_carsvg.skp_1_mpd	23.3ms -> 17.8ms	0.77x
                    desk_wowwiki.skp_1	4.21ms -> 3.21ms	0.76x
                     desk_amazon.skp_1	 963us ->  728us	0.76x
              desk_css3gradients.skp_1	2.58ms -> 1.92ms	0.74x
               tabl_cuteoverload.skp_1	4.55ms -> 3.38ms	0.74x
                        tabl_cnn.skp_1	3.13ms -> 2.29ms	0.73x
             tabl_googleblog.skp_1_mpd	2.32ms ->  1.7ms	0.73x
                 desk_mobilenews.skp_1	3.65ms -> 2.61ms	0.71x
                 desk_googleplus.skp_1	3.76ms -> 2.66ms	0.71x
                tabl_mozilla.skp_1_mpd	2.88ms -> 2.03ms	0.71x
              desk_pinterest.skp_1_mpd	3.17ms -> 2.21ms	0.7x
          desk_css3gradients.skp_1_mpd	2.98ms -> 2.07ms	0.69x
                desk_silkfinance.skp_1	2.06ms -> 1.42ms	0.69x
                   desk_facebook.skp_1	 4.5ms -> 3.07ms	0.68x
             desk_mobilenews.skp_1_mpd	4.05ms -> 2.73ms	0.68x
                  desk_baidu.skp_1_mpd	2.73ms -> 1.81ms	0.66x
                desk_weather.skp_1_mpd	3.93ms ->  2.5ms	0.64x
                  desk_wordpress.skp_1	2.15ms -> 1.36ms	0.63x
             desk_googlehome.skp_1_mpd	1.02ms ->  605us	0.59x
                   desk_fontwipe.skp_1	 722us ->  402us	0.56x
               desk_fontwipe.skp_1_mpd	 897us ->  486us	0.54x
                      desk_baidu.skp_1	3.02ms ->  1.6ms	0.53x
                 desk_forecastio.skp_1	2.01ms ->  999us	0.5x
                 desk_amazon.skp_1_mpd	1.77ms ->  860us	0.49x

BUG=skia:

Review URL: https://codereview.chromium.org/743613005
2014-11-25 14:34:03 -08:00
..
AAClipBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
AlternatingColorPatternBench.cpp Remove gpu shader optimatization for solid white or trans black colors 2014-07-21 11:37:28 -07:00
bench_compare.py Make bench_compare executable. 2013-11-12 15:25:31 +00:00
bench_util.py Restore bench_util.py 2014-08-08 17:28:53 -04:00
BenchLogger.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
BenchLogger.h Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
Benchmark.cpp Add MultiPictureDraw to nanobench 2014-11-21 06:19:36 -08:00
Benchmark.h Add MultiPictureDraw to nanobench 2014-11-21 06:19:36 -08:00
BezierBench.cpp Draw more accurate thick-stroked Beziers (disabled) 2014-10-09 05:36:04 -07:00
BitmapBench.cpp Revert "Revert of create shaderproc for nofilter-opaque-dx (patchset #7 id:120001 of https://codereview.chromium.org/664783004/)" 2014-10-23 14:35:01 -07:00
BitmapRectBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
BitmapScaleBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
BlurBench.cpp 2D kernel initial wiring for Guassian 2014-08-11 13:55:34 -07:00
BlurImageFilterBench.cpp 2D kernel initial wiring for Guassian 2014-08-11 13:55:34 -07:00
BlurRectBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
BlurRoundRectBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
ChartBench.cpp "NULL !=" = NULL 2014-09-05 13:34:00 -07:00
check_bench_regressions.py Adds dashboard link for one-line plot on each alert item. 2014-05-13 17:38:17 +00:00
ChecksumBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
ChromeBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
CmapBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
ColorCubeBench.cpp Attempt at fixing color cube bench 2014-10-09 11:35:09 -07:00
ColorFilterBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
ColorPrivBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
CoverageBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
DashBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
DecodeBench.cpp Cleanup: Rename SkOSPath functions. 2014-07-28 19:26:58 -07:00
DeferredSurfaceCopyBench.cpp check for newSurface failure 2014-10-02 12:58:49 -07:00
DisplacementBench.cpp remove unnecessary bitmapdevice references 2014-06-27 05:49:54 -07:00
ETCBitmapBench.cpp "NULL !=" = NULL 2014-09-05 13:34:00 -07:00
FontCacheBench.cpp Slim Skia down to just one murmur3 implementation. 2014-07-10 06:03:46 -07:00
FontScalerBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
FSRectBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
GameBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
gen_bench_expectations.py Added in framework to get more bench data 2014-06-12 11:27:40 -07:00
GeometryBench.cpp Revert of Start to vectorize SkTileGrid. (patchset #48 id:1670001 of https://codereview.chromium.org/634543004/) 2014-10-20 10:43:55 -07:00
GMBench.cpp SKPs-as-benches in nanobench 2014-08-01 07:46:53 -07:00
GMBench.h SKPs-as-benches in nanobench 2014-08-01 07:46:53 -07:00
GradientBench.cpp remove internal repeat count from gradient benches 2014-08-14 12:24:46 -07:00
GrMemoryPoolBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
GrOrderedSetBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
GrResourceCacheBench.cpp Use scratch keys for stencil buffers. 2014-11-25 05:52:06 -08:00
gUniqueGlyphIDs.h switch array to uint16_t to fix overflows 2013-06-11 19:53:19 +00:00
HairlinePathBench.cpp Avoid warning in nanobench related to loop count with nvprmsaa4 2014-11-11 06:57:07 -08:00
ImageCacheBench.cpp SkResourceCache::Key namespace support. 2014-10-22 11:20:40 -07:00
ImageDecodeBench.cpp Cleanup: Rename SkOSPath functions. 2014-07-28 19:26:58 -07:00
ImageFilterDAGBench.cpp draft gpu support in nanobench 2014-07-01 08:43:42 -07:00
InterpBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
LightingBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
LineBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
MagnifierBench.cpp remove unnecessary bitmapdevice references 2014-06-27 05:49:54 -07:00
MathBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
Matrix44Bench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
MatrixBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
MatrixConvolutionBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
MemcpyBench.cpp Clean up some benches that answer questions we're no longer asking. 2014-08-27 06:34:16 -07:00
MemoryBench.cpp Clean up some benches that answer questions we're no longer asking. 2014-08-27 06:34:16 -07:00
MemsetBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
MergeBench.cpp remove unnecessary bitmapdevice references 2014-06-27 05:49:54 -07:00
microbench.json Fix the other microbench schema 2014-07-25 08:30:11 -07:00
MorphologyBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
MutexBench.cpp Fix thread unsafe mutex initialization. 2014-07-25 11:52:48 -07:00
nanobench.cpp nanobench: lazily decode bitmaps in .skps. 2014-11-25 14:34:03 -08:00
PatchBench.cpp Added bench for grid of patches. 2014-08-15 13:30:47 -07:00
PatchGridBench.cpp Added bench for grid of patches. 2014-08-15 13:30:47 -07:00
PathBench.cpp (temporarily?) disable no-oped benches 2014-07-16 20:23:43 -04:00
PathIterBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
PathUtilsBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
PerlinNoiseBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
PictureNestingBench.cpp Do not calculate many sierpinski fractals for each nanobench run unless needed 2014-11-18 04:50:50 -08:00
PicturePlaybackBench.cpp add some debugging to SkNVRefCnt 2014-11-24 12:02:31 -08:00
PremulAndUnpremulAlphaOpsBench.cpp Use unpremul for premul_and_unpremul_alpha_ bench. 2014-07-11 10:45:11 -07:00
ReadPixBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
RecordingBench.cpp add some debugging to SkNVRefCnt 2014-11-24 12:02:31 -08:00
RecordingBench.h Measure picture recording speed in nanobench. 2014-09-10 12:19:30 -07:00
RectanizerBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
RectBench.cpp Remove aarects benchmark. Redundant with rotated_rects* bench and *much* slower. 2014-08-14 13:03:58 -07:00
RectoriBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
RefCntBench.cpp Add support for 64bit atomic inc/dec/cas 2014-07-11 08:42:11 -07:00
RegionBench.cpp cleanup and optimize rect intersect routines 2014-10-09 14:29:01 -07:00
RegionContainBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
RepeatTileBench.cpp remove alphatype from colortable 2014-09-29 12:10:27 -07:00
ResultsWriter.h nanobench: flush after recording every Nth data point. 2014-10-14 08:40:43 -07:00
RotatedRectBench.cpp Make the rotated rects bench allow more alpha/color variations and an arbitrary xfermode::mode. 2014-08-08 07:43:29 -07:00
RTreeBench.cpp Prune SkRTree 2014-11-18 09:27:49 -08:00
ScalarBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
ShaderMaskBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
SkipZeroesBench.cpp Qualify the return value of SkImageDecoder::decode 2014-10-22 12:07:00 -07:00
SKPBench.cpp Fix memory leak in nanobench 2014-11-21 06:53:00 -08:00
SKPBench.h Add MultiPictureDraw to nanobench 2014-11-21 06:19:36 -08:00
skpbench.json Fix scale type in JSON format 2014-06-26 15:39:31 -07:00
SortBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
StrokeBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
TableBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
TextBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
tile_analyze.py Script to plot tile vs. viewport comparison for given platform and revision. 2013-02-13 23:22:29 +00:00
TileBench.cpp Disable bogus _scaled benches until we can figure out why they're bogus. 2014-06-24 15:19:26 -07:00
VertBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
WritePixelsBench.cpp Hide fields in SkImageInfo 2014-09-03 11:54:58 -07:00
WriterBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
XfermodeBench.cpp "NULL !=" = NULL 2014-09-05 13:34:00 -07:00