diff options
author | Martin Peres <martin.peres@linux.intel.com> | 2016-01-25 16:58:16 +0200 |
---|---|---|
committer | Martin Peres <martin.peres@linux.intel.com> | 2016-01-25 16:58:16 +0200 |
commit | ba34558f35619c9a2a9f38ef85889e9633c252db (patch) | |
tree | 36afed64dfa2b54d8ac3ede2b943b3f3de1dbf5f | |
parent | bf2b0fa0782ede6374714dae8e85fe965cc53f68 (diff) |
ezbench.py: optimise the function looking for runs
The execution time got reduced from 6 to 1s on a large report.
-rw-r--r-- | utils/ezbench.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/ezbench.py b/utils/ezbench.py index 852f5ba..a3a62b3 100644 --- a/utils/ezbench.py +++ b/utils/ezbench.py @@ -1102,7 +1102,8 @@ def genPerformanceReport(log_folder, silentMode = False): benchmark.unit_str = result.unit_str # Look for the runs - runsFiles = [f for f in os.listdir() if re.search(r'^{benchFile}#[0-9]+$'.format(benchFile=benchFile), f)] + run_re = re.compile(r'^{benchFile}#[0-9]+$'.format(benchFile=benchFile)) + runsFiles = [f for f in os.listdir() 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) |