Use non-copying sorting in test harness.

R=machenbach@chromium.org

Review URL: https://codereview.chromium.org/300873006

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21569 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent cbd242f7
......@@ -64,8 +64,10 @@ class Runner(object):
self.perf_data_manager = perfdata.PerfDataManager(datapath)
self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode)
self.tests = [ t for s in suites for t in s.tests ]
for t in self.tests:
t.duration = self.perfdata.FetchPerfData(t) or 1.0
if not context.no_sorting:
for t in self.tests:
t.duration = self.perfdata.FetchPerfData(t) or 1.0
self.tests.sort(key=lambda t: t.duration, reverse=True)
self._CommonInit(len(self.tests), progress_indicator, context)
def _CommonInit(self, num_tests, progress_indicator, context):
......@@ -94,8 +96,6 @@ class Runner(object):
# while the queue is filled.
queue = []
queued_exception = None
if not self.context.no_sorting:
self.tests = sorted(self.tests, key=lambda t: t.duration, reverse=True)
for test in self.tests:
assert test.id >= 0
test_map[test.id] = test
......
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