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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py

Issue 2770023003: Improve performance of rebaselining after TestBaselineSet change. (Closed)
Patch Set: Created 3 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
index 406bcbe512426b0859d898758d86631ccf867c75..bfeb329c3430ce099f0114d783ba0ddf99562d88 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
@@ -144,6 +144,8 @@ class TestBaselineSet(object):
def __init__(self, host):
self._host = host
+ self._port = self._host.port_factory.get()
+ self._builder_names = set()
self._test_prefix_map = collections.defaultdict(list)
def __iter__(self):
@@ -154,10 +156,9 @@ class TestBaselineSet(object):
def _iter_combinations(self):
"""Iterates through (test, build) combinations."""
- port = self._host.port_factory.get()
for test_prefix, builds in self._test_prefix_map.iteritems():
- for build in builds:
- for test in port.tests([test_prefix]):
+ for test in self._port.tests([test_prefix]):
+ for build in builds:
yield (test, build)
def __str__(self):
@@ -172,11 +173,12 @@ class TestBaselineSet(object):
test_prefix: This can be a full test path, or directory of tests, or a path with globs.
build: A Build object. This specifies where to fetch baselines from.
"""
+ self._builder_names.add(build.builder_name)
self._test_prefix_map[test_prefix].append(build)
def all_builders(self):
"""Returns all builder names in in this collection."""
- return sorted({b.builder_name for _, b in self._iter_combinations()})
+ return self._builder_names
class CopyExistingBaselinesInternal(AbstractRebaseliningCommand):
@@ -407,8 +409,9 @@ class AbstractParallelRebaselineCommand(AbstractRebaseliningCommand):
rebaseline_commands = []
lines_to_remove = {}
+ builders_to_fetch_from = self._builders_to_fetch_from(test_baseline_set.all_builders())
for test, build in test_baseline_set:
- if build.builder_name not in self._builders_to_fetch_from(test_baseline_set.all_builders()):
+ if build.builder_name not in builders_to_fetch_from:
continue
suffixes = self._suffixes_for_actual_failures(test, build)
@@ -458,8 +461,8 @@ class AbstractParallelRebaselineCommand(AbstractRebaseliningCommand):
def _optimize_baselines(self, test_baseline_set, verbose=False):
"""Returns a list of commands to run in parallel to de-duplicate baselines."""
tests_to_suffixes = collections.defaultdict(set)
+ builders_to_fetch_from = self._builders_to_fetch_from(test_baseline_set.all_builders())
for test, build in test_baseline_set:
- builders_to_fetch_from = self._builders_to_fetch_from(test_baseline_set.all_builders())
if build.builder_name not in builders_to_fetch_from:
continue
tests_to_suffixes[test].update(self._suffixes_for_actual_failures(test, build))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698