From b3aa0bf474ac7ea0690194daf670bb9fc45e1cdf Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sat, 4 Nov 2023 23:28:25 -0500 Subject: [PATCH] Tweaked amor.py to use size field for amortized measurements This makes more sense when using benchmarks with sparse sampling rates. Otherwise the rate of sampling also scales the resulting measurements incorrectly. If the previous behavior is required (if you want to ignore buffer sizes when amortizing read/writes for example), the -n/--size field can always be omitted. --- scripts/amor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/amor.py b/scripts/amor.py index cbac7a69..9dd83093 100755 --- a/scripts/amor.py +++ b/scripts/amor.py @@ -84,11 +84,9 @@ def main(csv_paths, output, *, size=None, fields=None, defines=[]): - # default to amortizing and per-byte results if size is present + # default to amortizing if not amor and not per: amor = True - if size is not None: - per = True # separate out renames renames = list(it.chain.from_iterable( @@ -163,7 +161,7 @@ def main(csv_paths, output, *, # find amortized results if amor: amors.append(r - | {f: sums[f] / (j+1) for f in fields} + | {f: sums[f] / size_ for f in fields} | ({} if meas is None else {meas: r[meas]+'+amor'} if meas in r else {meas: 'amor'}))