Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: tools/perf/benchmarks/v8_browsing.py

Issue 2118293002: Add benchmark that imitates news reading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename benchmark and story set 2 Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/perf/page_sets/system_health/browsing_stories.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/benchmarks/v8_browsing.py
diff --git a/tools/perf/benchmarks/v8_browsing.py b/tools/perf/benchmarks/v8_browsing.py
new file mode 100644
index 0000000000000000000000000000000000000000..b40c01a425c9e1f8e2c96d476510012278fd1d89
--- /dev/null
+++ b/tools/perf/benchmarks/v8_browsing.py
@@ -0,0 +1,93 @@
+# Copyright 2016 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.
+
+import re
+
+from core import perf_benchmark
+from telemetry.timeline import chrome_trace_config
+from telemetry.timeline import chrome_trace_category_filter
+from telemetry.web_perf import timeline_based_measurement
+import page_sets
+
+
+# See tr.v.Numeric.getSummarizedScalarNumericsWithNames()
+# https://github.com/catapult-project/catapult/blob/master/tracing/tracing/value/numeric.html#L323
+_IGNORED_MEMORY_STATS_RE = re.compile(r'_(std|count|min|sum|pct_\d{4}(_\d+)?)$')
+
+# Track only the high-level GC stats to reduce the data load on dashboard.
+_IGNORED_V8_STATS_RE = re.compile(
+ r'_(idle_deadline_overrun|percentage_idle|outside_idle)')
+_V8_GC_HIGH_LEVEL_STATS_RE = re.compile(r'^v8-gc-('
+ r'full-mark-compactor_|'
+ r'incremental-finalize_|'
+ r'incremental-step_|'
+ r'latency-mark-compactor_|'
+ r'memory-mark-compactor_|'
+ r'scavenger_|'
+ r'gc-total_)')
+
+
+class _BrowsingBenchmark(perf_benchmark.PerfBenchmark):
+ """Base class for browsing benchmarks.
+ This benchmark measures memory usage with periodic memory dumps and v8 times.
+ See browsing_stories._BrowsingStory for workload description.
+ """
+
+ def CreateTimelineBasedMeasurementOptions(self):
+ categories = [
+ # Disable all categories by default.
+ '-*',
+ # Memory categories.
+ 'disabled-by-default-memory-infra',
+ # V8 categories.
+ 'blink.console',
+ 'disabled-by-default-v8.gc',
+ 'renderer.scheduler',
+ 'v8',
+ 'webkit.console',
+ ]
+ options = timeline_based_measurement.Options(
+ chrome_trace_category_filter.ChromeTraceCategoryFilter(
+ ','.join(categories)))
+ options.config.enable_android_graphics_memtrack = True
+ # Trigger periodic light memory dumps every 1000 ms.
+ memory_dump_config = chrome_trace_config.MemoryDumpConfig()
+ memory_dump_config.AddTrigger('light', 1000)
+ options.config.chrome_trace_config.SetMemoryDumpConfig(memory_dump_config)
+ options.SetTimelineBasedMetrics(['v8AndMemoryMetrics'])
+ return options
+
+ @classmethod
+ def Name(cls):
+ return 'v8.browsing_%s' % cls.page_set.PLATFORM
+
+ @classmethod
+ def ValueCanBeAddedPredicate(cls, value, is_first_result):
+ # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard
+ # is able to cope with the data load generated by TBMv2 metrics.
+ if 'memory:chrome' in value.name:
+ return ('renderer_processes' in value.name and
+ not _IGNORED_MEMORY_STATS_RE.search(value.name))
+ return (_V8_GC_HIGH_LEVEL_STATS_RE.search(value.name) and
+ not _IGNORED_V8_STATS_RE.search(value.name))
+
+ @classmethod
+ def ShouldTearDownStateAfterEachStoryRun(cls):
+ return True
+
+
+class DesktopNewsBenchmark(_BrowsingBenchmark):
petrcermak 2016/07/12 18:07:49 This should be DesktopBrowsingBenchmark
ulan 2016/07/13 12:47:31 Done.
+ page_set = page_sets.DesktopBrowsingSystemHealthStorySet
+
+ @classmethod
+ def ShouldDisable(cls, possible_browser):
+ return possible_browser.platform.GetDeviceTypeName() != 'Desktop'
+
+
+class MobileNewsBenchmark(_BrowsingBenchmark):
petrcermak 2016/07/12 18:07:50 This should be MobileBrowsingBenchmark
ulan 2016/07/13 12:47:31 Done.
+ page_set = page_sets.MobileBrowsingSystemHealthStorySet
+
+ @classmethod
+ def ShouldDisable(cls, possible_browser):
+ return possible_browser.platform.GetDeviceTypeName() == 'Desktop'
« no previous file with comments | « no previous file | tools/perf/page_sets/system_health/browsing_stories.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698