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

Side by Side Diff: tools/perf/benchmarks/memory_benchmark.py

Issue 1266833004: telemetry: Add a page set for blink's memory usage measurement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import re 5 import re
6 6
7 from core import perf_benchmark 7 from core import perf_benchmark
8 8
9 from telemetry import benchmark 9 from telemetry import benchmark
10 from telemetry.timeline import tracing_category_filter 10 from telemetry.timeline import tracing_category_filter
11 from telemetry.web_perf import timeline_based_measurement 11 from telemetry.web_perf import timeline_based_measurement
12 12
13 import page_sets 13 import page_sets
14 14
15 15
16 RE_BENCHMARK_VALUES = re.compile('(fore|back)ground-memory_') 16 class _MemoryBenchmark(perf_benchmark.PerfBenchmark):
17 17 """Base class for timeline based memory benchmark."""
perezju 2015/09/02 09:30:45 nit: benchmark -> benchmarks
bashi 2015/09/03 23:12:21 Done.
18
19 @benchmark.Enabled('android')
20 class MemoryHealthPlan(perf_benchmark.PerfBenchmark):
21 """Timeline based benchmark for the Memory Health Plan."""
22
23 page_set = page_sets.MemoryHealthStory
24 18
25 def SetExtraBrowserOptions(self, options): 19 def SetExtraBrowserOptions(self, options):
26 # TODO(perezju): Temporary workaround to disable periodic memory dumps. 20 # TODO(perezju): Temporary workaround to disable periodic memory dumps.
27 # See: http://crbug.com/513692 21 # See: http://crbug.com/513692
28 options.AppendExtraBrowserArgs('--enable-memory-benchmarking') 22 options.AppendExtraBrowserArgs('--enable-memory-benchmarking')
29 23
30 def CreateTimelineBasedMeasurementOptions(self): 24 def CreateTimelineBasedMeasurementOptions(self):
31 # Enable only memory-infra, to get memory dumps, and blink.console, to get 25 # Enable only memory-infra, to get memory dumps, and blink.console, to get
32 # the timeline markers used for mapping threads to tabs. 26 # the timeline markers used for mapping threads to tabs.
33 trace_memory = tracing_category_filter.TracingCategoryFilter( 27 trace_memory = tracing_category_filter.TracingCategoryFilter(
34 filter_string='-*,blink.console,disabled-by-default-memory-infra') 28 filter_string='-*,blink.console,disabled-by-default-memory-infra')
35 return timeline_based_measurement.Options(overhead_level=trace_memory) 29 return timeline_based_measurement.Options(overhead_level=trace_memory)
36 30
31
32 @benchmark.Enabled('android')
33 class MemoryHealthPlan(_MemoryBenchmark):
34 """Timeline based benchmark for the Memory Health Plan."""
35
36 _RE_BENCHMARK_VALUES = re.compile('(fore|back)ground-memory_')
37
38 page_set = page_sets.MemoryHealthStory
39
37 @classmethod 40 @classmethod
38 def Name(cls): 41 def Name(cls):
39 return 'memory.memory_health_plan' 42 return 'memory.memory_health_plan'
40 43
41 @classmethod 44 @classmethod
42 def ValueCanBeAddedPredicate(cls, value, is_first_result): 45 def ValueCanBeAddedPredicate(cls, value, is_first_result):
43 return bool(RE_BENCHMARK_VALUES.match(value.name)) 46 return bool(MemoryHealthPlan._RE_BENCHMARK_VALUES.match(value.name))
perezju 2015/09/02 09:30:45 nit: MemoryHealthPlan -> cls
bashi 2015/09/03 23:12:21 Done.
47
48
49 @benchmark.Enabled('android')
perezju 2015/09/02 09:30:45 Is there anything android-specific about this benc
nednguyen 2015/09/02 16:30:07 The fact that it uses BlinkMemoryMobilePageSet tel
bashi 2015/09/03 23:12:21 BlinkMemoryMobilePage already uses ShareMobilePage
50 class RendererMemoryBlinkMemoryMobile(_MemoryBenchmark):
51 """Timeline based benchmark for measuring memory consumption on mobile
52 sites on which blink's memory consumption is relatively high."""
53
54 _RE_RENDERER_VALUES = re.compile('.+-memory_.+_renderer')
55
56 page_set = page_sets.BlinkMemoryMobilePageSet
57
58 @classmethod
59 def Name(cls):
60 return 'memory.blink_memory_mobile'
61
62 @classmethod
63 def ValueCanBeAddedPredicate(cls, value, is_first_result):
64 return bool(
65 RendererMemoryBlinkMemoryMobile._RE_RENDERER_VALUES.match(value.name))
perezju 2015/09/02 09:30:45 nit: RendererMemoryBlinkMemoryMobile -> cls
bashi 2015/09/03 23:12:21 Done.
OLDNEW
« no previous file with comments | « no previous file | tools/perf/benchmarks/memory_health_plan.py » ('j') | tools/perf/page_sets/blink_memory_mobile.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698