Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / tools / perf / benchmarks / startup.py
blobc2313a5f46b7b4f96c93d215388880d6729b6a19
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 from core import perf_benchmark
6 from measurements import startup
7 import page_sets
8 from telemetry import benchmark
11 class _StartupCold(perf_benchmark.PerfBenchmark):
12 """Measures cold startup time with a clean profile."""
13 options = {'pageset_repeat': 5}
15 @classmethod
16 def Name(cls):
17 return 'startup'
19 def CreatePageTest(self, options):
20 return startup.Startup(cold=True)
23 class _StartupWarm(perf_benchmark.PerfBenchmark):
24 """Measures warm startup time with a clean profile."""
25 options = {'pageset_repeat': 20}
27 @classmethod
28 def Name(cls):
29 return 'startup'
31 @classmethod
32 def ValueCanBeAddedPredicate(cls, _, is_first_result):
33 return not is_first_result
35 def CreatePageTest(self, options):
36 return startup.Startup(cold=False)
39 @benchmark.Disabled('snowleopard') # crbug.com/336913
40 class StartupColdBlankPage(_StartupCold):
41 """Measures cold startup time with a clean profile."""
42 tag = 'cold'
43 page_set = page_sets.BlankPageSet
45 @classmethod
46 def Name(cls):
47 return 'startup.cold.blank_page'
50 class StartupWarmBlankPage(_StartupWarm):
51 """Measures warm startup time with a clean profile."""
52 tag = 'warm'
53 page_set = page_sets.BlankPageSet
55 @classmethod
56 def Name(cls):
57 return 'startup.warm.blank_page'
60 @benchmark.Disabled('reference', # http://crbug.com/476882
61 'android', # http://crbug.com/481919
62 'content-shell', 'mandoline') # No pregenerated profiles.
63 class StartupLargeProfileColdBlankPage(_StartupCold):
64 """Measures cold startup time with a large profile."""
65 tag = 'cold'
66 page_set = page_sets.BlankPageSetWithLargeProfile
67 options = {'pageset_repeat': 3}
69 def __init__(self, max_failures=None):
70 super(StartupLargeProfileColdBlankPage, self).__init__(max_failures)
72 def SetExtraBrowserOptions(self, options):
73 options.browser_startup_timeout = 10 * 60
75 @classmethod
76 def Name(cls):
77 return 'startup.large_profile.cold.blank_page'
80 @benchmark.Disabled('reference', # http://crbug.com/476882
81 'android', # http://crbug.com/481919
82 'content-shell', 'mandoline') # No pregenerated profiles.
83 class StartupLargeProfileWarmBlankPage(_StartupWarm):
84 """Measures warm startup time with a large profile."""
85 tag = 'warm'
86 page_set = page_sets.BlankPageSetWithLargeProfile
87 options = {'pageset_repeat': 4}
89 def __init__(self, max_failures=None):
90 super(StartupLargeProfileWarmBlankPage, self).__init__(max_failures)
92 def SetExtraBrowserOptions(self, options):
93 options.browser_startup_timeout = 10 * 60
95 @classmethod
96 def Name(cls):
97 return 'startup.large_profile.warm.blank_page'