Commit 8a3a03b6 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

Remove v8.detached_context_age_in_gc benchmark.

Blink document leak detector has similar coverage.

Bug: chromium:775635
Change-Id: I871ee0e8337dde3b326dab75d4d3af9ebb47ebe7
Reviewed-on: https://chromium-review.googlesource.com/980875
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#545967}
parent bebfc29b
This diff is collapsed.
......@@ -103,7 +103,6 @@ v8.browsing_desktop,"mythria@chromium.org, ulan@chromium.org",
v8.browsing_desktop-future,"mythria@chromium.org, ulan@chromium.org",
v8.browsing_mobile,"mythria@chromium.org, ulan@chromium.org",
v8.browsing_mobile-future,"mythria@chromium.org, ulan@chromium.org",
v8.detached_context_age_in_gc,ulan@chromium.org,
v8.runtime_stats.top_25,cbruni@chromium.org,
validating_command_buffer_perftests,"piman@chromium.org, chrome-gpu-perf-owners@chromium.org",Internals>GPU
views_perftests,tapted@chromium.org,Internals>Views
......
......@@ -4,7 +4,6 @@
from core import perf_benchmark
from measurements import v8_detached_context_age_in_gc
import page_sets
from telemetry import benchmark
......@@ -12,19 +11,6 @@ from telemetry.timeline import chrome_trace_category_filter
from telemetry.web_perf import timeline_based_measurement
@benchmark.Owner(emails=['ulan@chromium.org'])
class V8DetachedContextAgeInGC(perf_benchmark.PerfBenchmark):
"""Measures the number of GCs needed to collect a detached context.
http://www.chromium.org/developers/design-documents/rendering-benchmarks"""
test = v8_detached_context_age_in_gc.V8DetachedContextAgeInGC
page_set = page_sets.PageReloadCasesPageSet
@classmethod
def Name(cls):
return 'v8.detached_context_age_in_gc'
class _Top25RuntimeStats(perf_benchmark.PerfBenchmark):
def SetExtraBrowserOptions(self, options):
options.AppendExtraBrowserArgs(
......
# 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.
import json
from telemetry.page import legacy_page_test
from telemetry.value import histogram_util
from telemetry.value import scalar
_NAME = 'V8.DetachedContextAgeInGC'
_UNITS = 'garbage_collections'
_DISPLAY_NAME = 'V8_DetachedContextAgeInGC'
_TYPE = histogram_util.RENDERER_HISTOGRAM
_DESCRIPTION = 'Number of GCs needed to collect detached context'
def _GetMaxDetachedContextAge(tab, data_start):
data = histogram_util.GetHistogram(_TYPE, _NAME, tab)
delta = histogram_util.SubtractHistogram(data, data_start)
if not 'buckets' in delta:
return
buckets = json.loads(delta)['buckets']
if buckets:
return max(x.get('high', x['low']) for x in buckets)
class V8DetachedContextAgeInGC(legacy_page_test.LegacyPageTest):
def __init__(self):
super(V8DetachedContextAgeInGC, self).__init__()
self._data_start = None
def CustomizeBrowserOptions(self, options):
options.AppendExtraBrowserArgs(['--enable-stats-collection-bindings'])
def DidNavigateToPage(self, page, tab):
del page # unused
self._data_start = histogram_util.GetHistogram(_TYPE, _NAME, tab)
def ValidateAndMeasurePage(self, page, tab, results):
del page # unused
# Trigger GC to get histogram data.
# Seven GCs should be enough to collect any detached context.
# If a detached context survives more GCs then there is a leak.
MAX_AGE = 8
for _ in xrange(MAX_AGE):
tab.CollectGarbage()
value = _GetMaxDetachedContextAge(tab, self._data_start)
if value is None:
results.Skip('No detached contexts')
else:
results.AddValue(scalar.ScalarValue(
results.current_page, _DISPLAY_NAME, _UNITS, value,
description=_DESCRIPTION))
# 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.internal.results import page_test_results
from telemetry.page import page as page_module
from telemetry.testing import options_for_unittests
from telemetry.testing import page_test_test_case
from telemetry.util import wpr_modes
from measurements import v8_detached_context_age_in_gc
class FakePage(page_module.Page):
def __init__(self, url):
super(FakePage, self).__init__(url=url, name=url)
@property
def is_file(self):
return self._url.startswith('file://')
class FakeTab(object):
def __init__(self, histograms):
self.histograms = histograms
self.current_histogram_index = 0
def EvaluateJavaScript(self, script, **kwargs):
histogram_name = 'V8.DetachedContextAgeInGC'
if kwargs.get('name') == histogram_name or histogram_name in script:
self.current_histogram_index += 1
return self.histograms[self.current_histogram_index - 1]
return '{}'
def CollectGarbage(self):
pass
def _MeasureFakePage(histograms):
results = page_test_results.PageTestResults()
page = FakePage('file://blank.html')
tab = FakeTab(histograms)
metric = v8_detached_context_age_in_gc.V8DetachedContextAgeInGC()
results.WillRunPage(page)
metric.DidNavigateToPage(page, tab)
metric.ValidateAndMeasurePage(page, tab, results)
results.DidRunPage(page)
return results
def _ActualValues(results):
return dict((v.name, v) for v in results.all_page_specific_values)
class SimplePage(page_module.Page):
def __init__(self, page_set):
super(SimplePage, self).__init__(
'file://host.html', page_set, page_set.base_dir, name='host.html')
def RunPageInteractions(self, action_runner):
# Reload the page to detach the previous context.
action_runner.ReloadPage()
class V8DetachedContextAgeInGCTests(page_test_test_case.PageTestTestCase):
def setUp(self):
self._options = options_for_unittests.GetCopy()
self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
def testWithNoData(self):
histograms = [
"""{"count": 0, "buckets": []}""",
"""{"count": 0, "buckets": []}"""
]
results = _MeasureFakePage(histograms)
actual = _ActualValues(results)
self.assertTrue('skip' in actual)
self.assertFalse('V8_DetachedContextAgeInGC' in actual)
def testWithData(self):
histograms = [
"""{"count": 3, "buckets": [{"low": 1, "high": 2, "count": 1},
{"low": 2, "high": 3, "count": 2}]}""",
"""{"count": 4, "buckets": [{"low": 1, "high": 2, "count": 2},
{"low": 2, "high": 3, "count": 2}]}""",
]
results = _MeasureFakePage(histograms)
actual = _ActualValues(results)['V8_DetachedContextAgeInGC']
self.assertEqual(2, actual.value)
self.assertEqual('garbage_collections', actual.units)
def testWithSimplePage(self):
page_set = self.CreateEmptyPageSet()
page = SimplePage(page_set)
page_set.AddStory(page)
metric = v8_detached_context_age_in_gc.V8DetachedContextAgeInGC()
results = self.RunMeasurement(metric, page_set, options=self._options)
self.assertFalse(results.had_failures)
actual = _ActualValues(results)['V8_DetachedContextAgeInGC']
self.assertLessEqual(0, actual.value)
self.assertEqual('garbage_collections', actual.units)
# 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 shared_page_state
from telemetry import story
from page_sets import top_pages
def _Reload(action_runner):
# Numbers below are chosen arbitrarily. For the V8DetachedContextAgeInGC
# the number of reloads should be high enough so that V8 could do few
# incremental GCs.
NUMBER_OF_RELOADS = 7
WAIT_TIME = 2
for _ in xrange(NUMBER_OF_RELOADS):
action_runner.ReloadPage()
action_runner.Wait(WAIT_TIME)
def _CreatePageClassWithReload(page_cls):
class DerivedSmoothPage(page_cls): # pylint: disable=no-init
def RunPageInteractions(self, action_runner):
_Reload(action_runner)
return DerivedSmoothPage
class PageReloadCasesPageSet(story.StorySet):
""" Pages for testing GC efficiency on page reload. """
def __init__(self):
super(PageReloadCasesPageSet, self).__init__(
archive_data_file='data/top_25.json',
cloud_storage_bucket=story.PARTNER_BUCKET)
shared_desktop_state = shared_page_state.SharedDesktopPageState
self.AddStory(_CreatePageClassWithReload(
top_pages.GoogleWebSearchPage)(self, shared_desktop_state))
self.AddStory(_CreatePageClassWithReload(
top_pages.GoogleDocPage)(self, shared_desktop_state))
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