From 4b2762b40049ccf97269ed623af7419e2ebe69b9 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Mon, 12 Aug 2024 14:16:58 -0400 Subject: [PATCH 1/2] Flag significant differences in benchmark timing tables gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py - Flag timers (with " *") that vary by more than +/- 10% in the benchmark timing table output CHANGELOG.md - Updated accordingly --- CHANGELOG.md | 1 + gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py | 2 ++ gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py | 2 ++ 3 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dc282e..dec4e72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed - Fixed formatting error in `.github/workflows/stale.yml` that caused the Mark Stale Issues action not to run - Added brackets around `exempt-issue-labels` list in `.github/workflows/stale.yml` +- Now flag differences greater than +/- 10% in benchmark timing table outputs ## [1.5.0] - 2024-05-29 ### Added diff --git a/gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py b/gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py index a12f088..370b944 100644 --- a/gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py +++ b/gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py @@ -181,6 +181,8 @@ def print_timer(key, ref, dev, ofile): if np.abs(ref[key] > 0.0): pctdiff = ((dev[key] - ref[key]) / ref[key]) * 100.0 line = f"{key:<22} {ref[key]:>18.3f} {dev[key]:>18.3f} {pctdiff:>12.3e}" + if np.abs(pctdiff) >= 10.0: # Flag diffs > +/- 10% + line += " *" print(line, file=ofile) diff --git a/gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py b/gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py index 9fd74dd..920fefb 100644 --- a/gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py +++ b/gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py @@ -257,6 +257,8 @@ def print_timer(key, ref, dev, ofile): pctdiff = ((dev[key] - ref[key]) / ref[key]) * 100.0 line = \ f"{label:<22} {ref[key]:>18.3f} {dev[key]:>18.3f} {pctdiff:>12.3e}" + if np.abs(pctdiff) >= 10.0: # Flag diffs > +/- 10% + line += " *" print(line, file=ofile) From b07327d6bf8d71fc0352ee22d1c81d607267020d Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Wed, 14 Aug 2024 11:32:26 -0400 Subject: [PATCH 2/2] Now use floating-point for % diff in benchmark timing tables gcpy/benchmark/modules/benchmark_gcclassic_scrape_timers.py gcpy/benchmark/modules/benchmark_gchp_scrape_timers.py - Changed the "% diff" column from exponential format (12.3e) to floating-point format (12.3f) to make it easier to see large differences CHANGELOG.md - Updated accordingly Signed-off-by: Bob Yantosca --- CHANGELOG.md | 3 +++ gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py | 2 +- gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dec4e72..7a878b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to GCPy will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] - TBD +### Changed +- Changed format of `% diff` column from `12.3e` to `12.3f` in benchmark timing tables + ### Fixed - Fixed formatting error in `.github/workflows/stale.yml` that caused the Mark Stale Issues action not to run - Added brackets around `exempt-issue-labels` list in `.github/workflows/stale.yml` diff --git a/gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py b/gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py index 370b944..f828e22 100644 --- a/gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py +++ b/gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py @@ -180,7 +180,7 @@ def print_timer(key, ref, dev, ofile): pctdiff = np.nan if np.abs(ref[key] > 0.0): pctdiff = ((dev[key] - ref[key]) / ref[key]) * 100.0 - line = f"{key:<22} {ref[key]:>18.3f} {dev[key]:>18.3f} {pctdiff:>12.3e}" + line = f"{key:<22} {ref[key]:>18.3f} {dev[key]:>18.3f} {pctdiff:>12.3f}" if np.abs(pctdiff) >= 10.0: # Flag diffs > +/- 10% line += " *" print(line, file=ofile) diff --git a/gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py b/gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py index 920fefb..4c42b89 100644 --- a/gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py +++ b/gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py @@ -256,7 +256,7 @@ def print_timer(key, ref, dev, ofile): if np.abs(ref[key] > 0.0): pctdiff = ((dev[key] - ref[key]) / ref[key]) * 100.0 line = \ - f"{label:<22} {ref[key]:>18.3f} {dev[key]:>18.3f} {pctdiff:>12.3e}" + f"{label:<22} {ref[key]:>18.3f} {dev[key]:>18.3f} {pctdiff:>12.3f}" if np.abs(pctdiff) >= 10.0: # Flag diffs > +/- 10% line += " *" print(line, file=ofile)