summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordbeam <dbeam@chromium.org>2015-06-01 14:24:47 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-01 21:26:32 +0000
commit754b802e2d3c65d15a93a0ffcb62ecca1001da1e (patch)
treefb040d67461127ffaab416f5e09274301be56f52
parent9b06a77874890485b31f69ee5e68111c23e04b17 (diff)
downloadchromium_src-754b802e2d3c65d15a93a0ffcb62ecca1001da1e.zip
chromium_src-754b802e2d3c65d15a93a0ffcb62ecca1001da1e.tar.gz
chromium_src-754b802e2d3c65d15a93a0ffcb62ecca1001da1e.tar.bz2
Perf tests for Plugin Power Saver take 2.
This time, with more throttled plugins! I'm adding 2 different benchmarks: 1) some popular sites that have throttled foreground plugins 2) a control site that we should also do well on and creating tests that will run both benchmarks with and without PPS. R=sullivan@chromium.org BUG=478918 CQ_EXTRA_TRYBOTS=tryserver.chromium.perf:linux_perf_bisect;tryserver.chromium.perf:mac_perf_bisect;tryserver.chromium.perf:win_perf_bisect;tryserver.chromium.perf:android_nexus5_perf_bisect Review URL: https://codereview.chromium.org/1144383005 Cr-Commit-Position: refs/heads/master@{#332270}
-rw-r--r--tools/perf/benchmarks/power.py62
-rw-r--r--tools/perf/benchmarks/tab_switching.py4
-rw-r--r--tools/perf/page_sets/data/plugin_power_saver.json8
-rw-r--r--tools/perf/page_sets/data/plugin_power_saver_000.wpr.sha11
-rw-r--r--tools/perf/page_sets/data/throttled_plugins.json11
-rw-r--r--tools/perf/page_sets/data/throttled_plugins_004.wpr.sha11
-rw-r--r--tools/perf/page_sets/plugin_power_saver.py16
-rw-r--r--tools/perf/page_sets/throttled_plugins.py22
8 files changed, 123 insertions, 2 deletions
diff --git a/tools/perf/benchmarks/power.py b/tools/perf/benchmarks/power.py
index ba29d15..bc59b5c 100644
--- a/tools/perf/benchmarks/power.py
+++ b/tools/perf/benchmarks/power.py
@@ -70,3 +70,65 @@ class PowerTop25(perf_benchmark.PerfBenchmark):
if found:
user_stories.RemoveUserStory(found)
return user_stories
+
+
+@benchmark.Enabled('linux', 'mac', 'win', 'chromeos')
+class PowerPPSControlDisabled(perf_benchmark.PerfBenchmark):
+ """A single page with a small-ish non-essential plugin. In this test, Plugin
+ Power Saver (PPS) is disabled, so the plugin should continue animating and
+ taking power."""
+ test = power.QuiescentPower
+ page_set = page_sets.PluginPowerSaverPageSet
+
+ def SetExtraBrowserOptions(self, options):
+ options.AppendExtraBrowserArgs(['--disable-plugin-power-saver'])
+
+ @classmethod
+ def Name(cls):
+ return 'power.pps_control_disabled'
+
+
+@benchmark.Enabled('linux', 'mac', 'win', 'chromeos')
+class PowerPPSControlEnabled(perf_benchmark.PerfBenchmark):
+ """A single page with a small-ish non-essential plugin. In this test, Plugin
+ Power Saver (PPS) is enabled, so the plugin should be throttled (idle with a
+ "Click to play" button)."""
+ test = power.QuiescentPower
+ page_set = page_sets.PluginPowerSaverPageSet
+
+ def SetExtraBrowserOptions(self, options):
+ options.AppendExtraBrowserArgs(['--enable-plugin-power-saver'])
+
+ @classmethod
+ def Name(cls):
+ return 'power.pps_control_enabled'
+
+
+@benchmark.Enabled('linux', 'mac', 'win', 'chromeos')
+class PowerThrottledPlugins(perf_benchmark.PerfBenchmark):
+ """Tests that pages with flash ads take more power without Plugin Power Saver
+ (PPS) throttling them."""
+ test = power.QuiescentPower
+ page_set = page_sets.ThrottledPluginsPageSet
+
+ def SetExtraBrowserOptions(self, options):
+ options.AppendExtraBrowserArgs(['--disable-plugin-power-saver'])
+
+ @classmethod
+ def Name(cls):
+ return 'power.throttled_plugins_pps_disabled'
+
+
+@benchmark.Enabled('linux', 'mac', 'win', 'chromeos')
+class PowerThrottledPluginsPPS(perf_benchmark.PerfBenchmark):
+ """Tests that pages with flash ads take less power with Plugin Power Saver
+ (PPS) enabled to throttle them."""
+ test = power.QuiescentPower
+ page_set = page_sets.ThrottledPluginsPageSet
+
+ def SetExtraBrowserOptions(self, options):
+ options.AppendExtraBrowserArgs(['--enable-plugin-power-saver'])
+
+ @classmethod
+ def Name(cls):
+ return 'power.throttled_plugins_pps_enabled'
diff --git a/tools/perf/benchmarks/tab_switching.py b/tools/perf/benchmarks/tab_switching.py
index 3dbacf6..3b2bbe1 100644
--- a/tools/perf/benchmarks/tab_switching.py
+++ b/tools/perf/benchmarks/tab_switching.py
@@ -104,7 +104,7 @@ class TabSwitchingToughImageCases(perf_benchmark.PerfBenchmark):
return 'tab_switching.tough_image_cases'
-@benchmark.Enabled('linux', 'mac', 'win', 'chromeos')
+@benchmark.Disabled
class TabSwitchingFlashEnergyCases(perf_benchmark.PerfBenchmark):
test = tab_switching.TabSwitching
page_set = page_sets.FlashEnergyCasesPageSet
@@ -115,7 +115,7 @@ class TabSwitchingFlashEnergyCases(perf_benchmark.PerfBenchmark):
return 'tab_switching.flash_energy_cases'
-@benchmark.Enabled('linux', 'mac', 'win', 'chromeos')
+@benchmark.Disabled
class TabSwitchingPluginPowerSaver(perf_benchmark.PerfBenchmark):
test = tab_switching.TabSwitching
page_set = page_sets.FlashEnergyCasesPageSet
diff --git a/tools/perf/page_sets/data/plugin_power_saver.json b/tools/perf/page_sets/data/plugin_power_saver.json
new file mode 100644
index 0000000..6949941
--- /dev/null
+++ b/tools/perf/page_sets/data/plugin_power_saver.json
@@ -0,0 +1,8 @@
+{
+ "description": "Describes the Web Page Replay archives for a user story set. Don't edit by hand! Use record_wpr for updating.",
+ "archives": {
+ "plugin_power_saver_000.wpr": [
+ "http://a.tommycli.com/small_only.html"
+ ]
+ }
+} \ No newline at end of file
diff --git a/tools/perf/page_sets/data/plugin_power_saver_000.wpr.sha1 b/tools/perf/page_sets/data/plugin_power_saver_000.wpr.sha1
new file mode 100644
index 0000000..c5c5884
--- /dev/null
+++ b/tools/perf/page_sets/data/plugin_power_saver_000.wpr.sha1
@@ -0,0 +1 @@
+b0581609177ab49003635f44a4dddabf4872955f \ No newline at end of file
diff --git a/tools/perf/page_sets/data/throttled_plugins.json b/tools/perf/page_sets/data/throttled_plugins.json
new file mode 100644
index 0000000..caf6807
--- /dev/null
+++ b/tools/perf/page_sets/data/throttled_plugins.json
@@ -0,0 +1,11 @@
+{
+ "description": "Describes the Web Page Replay archives for a user story set. Don't edit by hand! Use record_wpr for updating.",
+ "archives": {
+ "throttled_plugins_004.wpr": [
+ "http://techcrunch.com",
+ "http://youtube.com",
+ "http://cnn.com",
+ "http://wsj.com"
+ ]
+ }
+} \ No newline at end of file
diff --git a/tools/perf/page_sets/data/throttled_plugins_004.wpr.sha1 b/tools/perf/page_sets/data/throttled_plugins_004.wpr.sha1
new file mode 100644
index 0000000..e7ddbf4
--- /dev/null
+++ b/tools/perf/page_sets/data/throttled_plugins_004.wpr.sha1
@@ -0,0 +1 @@
+372dd8d1aedc69155531c3970155319b6e15bb7b \ No newline at end of file
diff --git a/tools/perf/page_sets/plugin_power_saver.py b/tools/perf/page_sets/plugin_power_saver.py
new file mode 100644
index 0000000..fb13b44
--- /dev/null
+++ b/tools/perf/page_sets/plugin_power_saver.py
@@ -0,0 +1,16 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from telemetry.page import page
+from telemetry.page import page_set
+
+
+class PluginPowerSaverPageSet(page_set.PageSet):
+ def __init__(self):
+ super(PluginPowerSaverPageSet, self).__init__(
+ user_agent_type='desktop',
+ archive_data_file='data/plugin_power_saver.json',
+ bucket=page_set.PUBLIC_BUCKET)
+ self.AddUserStory(page.Page('http://a.tommycli.com/small_only.html',
+ page_set=self))
diff --git a/tools/perf/page_sets/throttled_plugins.py b/tools/perf/page_sets/throttled_plugins.py
new file mode 100644
index 0000000..3a72c3e
--- /dev/null
+++ b/tools/perf/page_sets/throttled_plugins.py
@@ -0,0 +1,22 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from telemetry.page import page
+from telemetry.page import page_set
+
+
+class ThrottledPluginsPageSet(page_set.PageSet):
+ def __init__(self):
+ super(ThrottledPluginsPageSet, self).__init__(
+ user_agent_type='desktop',
+ archive_data_file='data/throttled_plugins.json',
+ bucket=page_set.PUBLIC_BUCKET)
+ urls_with_throttled_plugins = [
+ 'http://cnn.com',
+ 'http://techcrunch.com',
+ 'http://wsj.com',
+ 'http://youtube.com'
+ ]
+ for url in urls_with_throttled_plugins:
+ self.AddUserStory(page.Page(url, page_set=self))