Commit 59bf3021 authored by Juan A. Navarro Perez's avatar Juan A. Navarro Perez Committed by Commit Bot

[tools/perf] Tweak memory.top_10_mobile story flow

This change modifies the benchmark's story flow in two ways:
- about:blank will no longer be loaded before pushing the browser to
  the background. Thus making the background measurement more realistic
- the browser will now be restarted between each foreground/background
  pair of stories; this will make each pair stories independent of each
  other, helping to make results more reproducible and less noisy.

Perf sheriffs warning: This is expected to affect memory measurements
for this benchmark.

Bug: 750055
Change-Id: I65ea9431d52f63ee3e7dfccad68a62476018ea99
Reviewed-on: https://chromium-review.googlesource.com/612980
Commit-Queue: Juan Antonio Navarro Pérez <perezju@chromium.org>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#501274}
parent db983b34
...@@ -14,15 +14,9 @@ from page_sets import top_10_mobile ...@@ -14,15 +14,9 @@ from page_sets import top_10_mobile
class Top10MobileSharedState(shared_page_state.SharedMobilePageState): class Top10MobileSharedState(shared_page_state.SharedMobilePageState):
def __init__(self, test, finder_options, story_set):
super(Top10MobileSharedState, self).__init__(
test, finder_options, story_set)
self._story_set = story_set
def ShouldStopBrowserAfterStoryRun(self, story): def ShouldStopBrowserAfterStoryRun(self, story):
# Close the browser after the last story in the set. # Close the browser after each background story.
# TODO(crbug.com/750055): Switch to close after each background page. return isinstance(story, BackgroundPage)
return self._story_set[-1] == story
class MemoryMeasurementPage(page_module.Page): class MemoryMeasurementPage(page_module.Page):
...@@ -58,17 +52,17 @@ class BackgroundPage(MemoryMeasurementPage): ...@@ -58,17 +52,17 @@ class BackgroundPage(MemoryMeasurementPage):
def __init__(self, story_set, name): def __init__(self, story_set, name):
super(BackgroundPage, self).__init__(story_set, name, 'about:blank') super(BackgroundPage, self).__init__(story_set, name, 'about:blank')
def RunPageInteractions(self, action_runner): def RunNavigateSteps(self, action_runner):
action_runner.tab.WaitForDocumentReadyStateToBeComplete()
# Launch clock app, pushing Chrome to the background. # Launch clock app, pushing Chrome to the background.
android_browser = action_runner.tab.browser android_browser = action_runner.tab.browser
android_browser.Background() android_browser.Background()
def RunPageInteractions(self, action_runner):
# Take measurement. # Take measurement.
action_runner.MeasureMemory(self.story_set.DETERMINISTIC_MODE) action_runner.MeasureMemory(self.story_set.DETERMINISTIC_MODE)
# Go back to Chrome. # Go back to Chrome.
android_browser = action_runner.tab.browser
android_browser.platform.android_action_runner.InputKeyEvent( android_browser.platform.android_action_runner.InputKeyEvent(
keyevent.KEYCODE_BACK) keyevent.KEYCODE_BACK)
...@@ -86,6 +80,8 @@ class MemoryTop10Mobile(story_module.StorySet): ...@@ -86,6 +80,8 @@ class MemoryTop10Mobile(story_module.StorySet):
# We name pages so their foreground/background counterparts are easy # We name pages so their foreground/background counterparts are easy
# to identify. For example 'http://google.com' becomes # to identify. For example 'http://google.com' becomes
# 'http_google_com' and 'after_http_google_com' respectively. # 'http_google_com' and 'after_http_google_com' respectively.
# This also allows to use e.g. '--story-filter http_google_com' to
# match and run both parts of the story.
name = re.sub(r'\W+', '_', url) name = re.sub(r'\W+', '_', url)
self.AddStory(ForegroundPage(self, name, url)) self.AddStory(ForegroundPage(self, name, url))
self.AddStory(BackgroundPage(self, 'after_' + name)) self.AddStory(BackgroundPage(self, 'after_' + name))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment