diff options
Diffstat (limited to 'lab/benchmark.py')
-rw-r--r-- | lab/benchmark.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lab/benchmark.py b/lab/benchmark.py index 8bde9bf4..8e340562 100644 --- a/lab/benchmark.py +++ b/lab/benchmark.py @@ -297,6 +297,14 @@ class Coverage: # Tweaks to the .coveragerc file options: Optional[str] = None +class CoveragePR(Coverage): + """A version of coverage.py from a pull request.""" + def __init__(self, number, options=None): + super().__init__( + slug=f"#{number}", + pip_args=f"git+https://github.com/nedbat/coveragepy.git@refs/pull/{number}/merge", + options=options, + ) @dataclasses.dataclass class Env: @@ -423,6 +431,29 @@ with change_dir(PERF_DIR): if 1: exp = Experiment( py_versions=[ + Python(3, 11), + ], + cov_versions=[ + Coverage("6.4.1", "coverage==6.4.1"), + CoveragePR(1394), + ], + projects=[ + AdHocProject("/src/bugs/bug1339/bug1339.py"), + SlipcoverBenchmark("bm_sudoku.py"), + SlipcoverBenchmark("bm_spectral_norm.py"), + ], + ) + exp.run(num_runs=5) + exp.show_results( + rows=["pyver", "proj"], + column="cov", + ratios=[ + ("#1394 vs 6.4.1", "#1394", "6.4.1"), + ], + ) + if 0: + exp = Experiment( + py_versions=[ Python(3, 10), Python(3, 11), #AdHocPython("/usr/local/cpython", "gh93493"), |