[llvm-commits] [zorg] r151197 - in /zorg/trunk/lnt/lnt/server/reporting: analysis.py runs.py
Daniel Dunbar
daniel at zuster.org
Wed Feb 22 12:37:17 PST 2012
Author: ddunbar
Date: Wed Feb 22 14:37:17 2012
New Revision: 151197
URL: http://llvm.org/viewvc/llvm-project?rev=151197&view=rev
Log:
[lnt] lnt.server.reporting.runs: Change RunInfo to load runs up front.
- Good for ~10% improvement speedup in report generation.
Modified:
zorg/trunk/lnt/lnt/server/reporting/analysis.py
zorg/trunk/lnt/lnt/server/reporting/runs.py
Modified: zorg/trunk/lnt/lnt/server/reporting/analysis.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/reporting/analysis.py?rev=151197&r1=151196&r2=151197&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/reporting/analysis.py (original)
+++ zorg/trunk/lnt/lnt/server/reporting/analysis.py Wed Feb 22 14:37:17 2012
@@ -8,12 +8,14 @@
from lnt.testing import PASS, FAIL, XFAIL
class RunInfo(object):
- def __init__(self, testsuite):
+ def __init__(self, testsuite, runs_to_load):
self.testsuite = testsuite
self.sample_map = util.multidict()
self.loaded_run_ids = set()
+ self._load_samples_for_runs(runs_to_load)
+
def get_run_comparison_result(self, run, compare_to, test_id, field,
comparison_window=[]):
# Get the field which indicates the requested field's status.
@@ -25,11 +27,6 @@
compare_id = None
else:
compare_id = compare_to.id
- runs_to_load = set([r.id for r in comparison_window])
- runs_to_load.add(run.id)
- if compare_id is not None:
- runs_to_load.add(compare_id)
- self._load_samples_for_runs(runs_to_load)
# Lookup the current and previous samples.
run_samples = self.sample_map.get((run.id, test_id), ())
Modified: zorg/trunk/lnt/lnt/server/reporting/runs.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/reporting/runs.py?rev=151197&r1=151196&r2=151197&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/reporting/runs.py (original)
+++ zorg/trunk/lnt/lnt/server/reporting/runs.py Wed Feb 22 14:37:17 2012
@@ -29,7 +29,6 @@
ts = run.testsuite
machine = run.machine
machine_parameters = machine.parameters
- sri = lnt.server.reporting.analysis.RunInfo(ts)
# Gather the runs to use for statistical data.
comparison_window = list(ts.get_previous_runs_on_machine(
@@ -42,6 +41,13 @@
# Get the test names.
test_names = ts.query(ts.Test.name, ts.Test.id).order_by(ts.Test.name).all()
+ # Create the run info analysis object.
+ runs_to_load = set(r.id for r in comparison_window)
+ runs_to_load.add(run.id)
+ if compare_to:
+ runs_to_load.add(compare_to.id)
+ sri = lnt.server.reporting.analysis.RunInfo(ts, runs_to_load)
+
# Gather the changes to report, organized by field and then collated by
# change type.
primary_fields = list(ts.Sample.get_primary_fields())
More information about the llvm-commits
mailing list