diff options
author | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-18 16:02:37 +0000 |
---|---|---|
committer | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-18 16:02:37 +0000 |
commit | 6ec23f84919598c1417904be63b742039d4543a8 (patch) | |
tree | db15c2e34f3a13f6e0a50e69203cd52afb2d262d /cc/layers/picture_layer_impl_perftest.cc | |
parent | 2260e5bfbf2a22b288a3f0702e284f3869a62693 (diff) | |
download | chromium_src-6ec23f84919598c1417904be63b742039d4543a8.zip chromium_src-6ec23f84919598c1417904be63b742039d4543a8.tar.gz chromium_src-6ec23f84919598c1417904be63b742039d4543a8.tar.bz2 |
cc: Add layer raster tile iterator construct perftest
This patch adds a layer level raster tile perftest to measure how
expensive is it to create a layer raster tile iterator.
Initial run:
[ RUN ] PictureLayerImplPerfTest.LayerRasterTileIteratorConstructAndIterate
*RESULT layer_raster_tile_iterator_construct_and_iterate: 32_100x100= 389462.09375 runs/s
*RESULT layer_raster_tile_iterator_construct_and_iterate: 32_500x500= 392804.6875 runs/s
*RESULT layer_raster_tile_iterator_construct_and_iterate: 64_100x100= 230574.3125 runs/s
*RESULT layer_raster_tile_iterator_construct_and_iterate: 64_500x500= 230933.953125 runs/s
[ OK ] PictureLayerImplPerfTest.LayerRasterTileIteratorConstructAndIterate (8408 ms)
[ RUN ] PictureLayerImplPerfTest.LayerRasterTileIteratorConstruct
*RESULT layer_raster_tile_iterator_construct: 0_0_100x100= 2187284 runs/s
*RESULT layer_raster_tile_iterator_construct: 5000_0_100x100= 1882842.125 runs/s
*RESULT layer_raster_tile_iterator_construct: 9999_0_100x100= 2171275 runs/s
[ OK ] PictureLayerImplPerfTest.LayerRasterTileIteratorConstruct (7619 ms)
NOTE TO PERF SHERIFFS
---------------------
This patch replaces layer_raster_tile_iterator test with
layer_raster_tile_iterator_construct_and_iterate test.
R=reveman
Review URL: https://codereview.chromium.org/400753002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/picture_layer_impl_perftest.cc')
-rw-r--r-- | cc/layers/picture_layer_impl_perftest.cc | 70 |
1 files changed, 57 insertions, 13 deletions
diff --git a/cc/layers/picture_layer_impl_perftest.cc b/cc/layers/picture_layer_impl_perftest.cc index e40c7a5..1aff9ad 100644 --- a/cc/layers/picture_layer_impl_perftest.cc +++ b/cc/layers/picture_layer_impl_perftest.cc @@ -68,24 +68,46 @@ class PictureLayerImplPerfTest : public testing::Test { pending_layer_->DoPostCommitInitializationIfNeeded(); } - void RunLayerRasterTileIteratorTest(const std::string& test_name, - int num_tiles, - const gfx::Size& viewport_size) { + void RunRasterIteratorConstructAndIterateTest( + const std::string& test_name, + int num_tiles, + const gfx::Size& viewport_size) { host_impl_.SetViewportSize(viewport_size); host_impl_.pending_tree()->UpdateDrawProperties(); timer_.Reset(); do { int count = num_tiles; - for (PictureLayerImpl::LayerRasterTileIterator it(pending_layer_, false); - it && count; - ++it) { - --count; + PictureLayerImpl::LayerRasterTileIterator it(pending_layer_, false); + while (count--) { + ASSERT_TRUE(it) << "count: " << count; + ASSERT_TRUE(*it != NULL) << "count: " << count; + ++it; } timer_.NextLap(); } while (!timer_.HasTimeLimitExpired()); - perf_test::PrintResult("layer_raster_tile_iterator", + perf_test::PrintResult("layer_raster_tile_iterator_construct_and_iterate", + "", + test_name, + timer_.LapsPerSecond(), + "runs/s", + true); + } + + void RunRasterIteratorConstructTest(const std::string& test_name, + const gfx::Rect& viewport) { + host_impl_.SetViewportSize(viewport.size()); + pending_layer_->SetScrollOffset(gfx::Vector2d(viewport.x(), viewport.y())); + host_impl_.pending_tree()->UpdateDrawProperties(); + + timer_.Reset(); + do { + PictureLayerImpl::LayerRasterTileIterator it(pending_layer_, false); + timer_.NextLap(); + } while (!timer_.HasTimeLimitExpired()); + + perf_test::PrintResult("layer_raster_tile_iterator_construct", "", test_name, timer_.LapsPerSecond(), @@ -163,7 +185,28 @@ class PictureLayerImplPerfTest : public testing::Test { DISALLOW_COPY_AND_ASSIGN(PictureLayerImplPerfTest); }; -TEST_F(PictureLayerImplPerfTest, LayerRasterTileIterator) { +TEST_F(PictureLayerImplPerfTest, LayerRasterTileIteratorConstructAndIterate) { + SetupPendingTree(gfx::Size(10000, 10000), gfx::Size(256, 256)); + + float low_res_factor = host_impl_.settings().low_res_contents_scale_factor; + + pending_layer_->AddTiling(low_res_factor); + pending_layer_->AddTiling(0.3f); + pending_layer_->AddTiling(0.7f); + pending_layer_->AddTiling(1.0f); + pending_layer_->AddTiling(2.0f); + + RunRasterIteratorConstructAndIterateTest( + "32_100x100", 32, gfx::Size(100, 100)); + RunRasterIteratorConstructAndIterateTest( + "32_500x500", 32, gfx::Size(500, 500)); + RunRasterIteratorConstructAndIterateTest( + "64_100x100", 64, gfx::Size(100, 100)); + RunRasterIteratorConstructAndIterateTest( + "64_500x500", 64, gfx::Size(500, 500)); +} + +TEST_F(PictureLayerImplPerfTest, LayerRasterTileIteratorConstruct) { SetupPendingTree(gfx::Size(10000, 10000), gfx::Size(256, 256)); float low_res_factor = host_impl_.settings().low_res_contents_scale_factor; @@ -174,10 +217,11 @@ TEST_F(PictureLayerImplPerfTest, LayerRasterTileIterator) { pending_layer_->AddTiling(1.0f); pending_layer_->AddTiling(2.0f); - RunLayerRasterTileIteratorTest("32_100x100", 32, gfx::Size(100, 100)); - RunLayerRasterTileIteratorTest("32_500x500", 32, gfx::Size(500, 500)); - RunLayerRasterTileIteratorTest("64_100x100", 64, gfx::Size(100, 100)); - RunLayerRasterTileIteratorTest("64_500x500", 64, gfx::Size(500, 500)); + RunRasterIteratorConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); + RunRasterIteratorConstructTest("5000_0_100x100", + gfx::Rect(5000, 0, 100, 100)); + RunRasterIteratorConstructTest("9999_0_100x100", + gfx::Rect(9999, 0, 100, 100)); } TEST_F(PictureLayerImplPerfTest, LayerEvictionTileIteratorConstructAndIterate) { |