summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Peres <martin.peres@linux.intel.com>2016-01-25 17:18:47 +0200
committerMartin Peres <martin.peres@linux.intel.com>2016-01-25 17:18:47 +0200
commita3ec69a01b1fbf029ee5af80f029c477a281c906 (patch)
tree4c3b45337ec56ffe5e527228764f51de4169ec93
parenta15ae9ce39b67efeeb2d669885eb799a6e21f36f (diff)
ezbench.py: avoid listing all the files twice
This commit also reduces the number of comparaisons as we restrict the search of run files to the list of files related to the current commit. This cuts the execution time by 60% on insane reports.
-rw-r--r--utils/ezbench.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/ezbench.py b/utils/ezbench.py
index 1fe2257..a42532c 100644
--- a/utils/ezbench.py
+++ b/utils/ezbench.py
@@ -1062,8 +1062,9 @@ def genPerformanceReport(log_folder, silentMode = False):
commit = Commit(sha1, full_name, compile_log, patch, label)
# find all the benchmarks
+ files_list = os.listdir()
pattern = "{sha1}_bench".format(sha1=commit.sha1)
- benchFiles = [f for f in os.listdir(".") if f.startswith(pattern)]
+ benchFiles = [f for f in files_list if f.startswith(pattern)]
benchs_txt = ""
for benchFile in benchFiles:
# Skip when the file is a run file (finishes by #XX)
@@ -1104,7 +1105,7 @@ def genPerformanceReport(log_folder, silentMode = False):
# Look for the runs
run_re = re.compile(r'^{benchFile}#[0-9]+$'.format(benchFile=benchFile))
- runsFiles = [f for f in os.listdir() if run_re.search(f)]
+ runsFiles = [f for f in benchFiles if run_re.search(f)]
runsFiles.sort(key=lambda x: '{0:0>100}'.format(x).lower()) # Sort the runs in natural order
for runFile in runsFiles:
data, unit, more_is_better = readCsv(runFile)