Skip to content

Commit

Permalink
refactor(benchmark): move benchmark.py to its own directory
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 7, 2023
1 parent 4d6ac8b commit 2fa45d6
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 57 deletions.
57 changes: 0 additions & 57 deletions lab/benchmark.py → lab/benchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,60 +582,3 @@ def run_experiment(
)
exp.run(num_runs=int(sys.argv[1]))
exp.show_results(rows=rows, column=column, ratios=ratios)


if 0:
run_experiment(
py_versions=[
# Python(3, 11),
AdHocPython("/usr/local/cpython/v3.10.5", "v3.10.5"),
AdHocPython("/usr/local/cpython/v3.11.0b3", "v3.11.0b3"),
AdHocPython("/usr/local/cpython/94231", "94231"),
],
cov_versions=[
Coverage("6.4.1", "coverage==6.4.1"),
],
projects=[
AdHocProject("/src/bugs/bug1339/bug1339.py"),
SlipcoverBenchmark("bm_sudoku.py"),
SlipcoverBenchmark("bm_spectral_norm.py"),
],
rows=["cov", "proj"],
column="pyver",
ratios=[
("3.11b3 vs 3.10", "v3.11.0b3", "v3.10.5"),
("94231 vs 3.10", "94231", "v3.10.5"),
],
)


if 1:
run_experiment(
py_versions=[
Python(3, 9),
Python(3, 11),
],
cov_versions=[
Coverage("701", "coverage==7.0.1"),
Coverage(
"701.dynctx", "coverage==7.0.1", [("dynamic_context", "test_function")]
),
Coverage("702", "coverage==7.0.2"),
Coverage(
"702.dynctx", "coverage==7.0.2", [("dynamic_context", "test_function")]
),
],
projects=[
# EmptyProject("empty", [1.2, 3.4]),
# EmptyProject("dummy", [6.9, 7.1]),
# ProjectDateutil(),
ProjectAttrs(),
],
rows=["proj", "pyver"],
column="cov",
ratios=[
(".2 vs .1", "702", "701"),
(".1 dynctx cost", "701.dynctx", "701"),
(".2 dynctx cost", "702.dynctx", "702"),
],
)
29 changes: 29 additions & 0 deletions lab/benchmark/empty.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from benchmark import *

run_experiment(
py_versions=[
Python(3, 9),
Python(3, 11),
],
cov_versions=[
Coverage("701", "coverage==7.0.1"),
Coverage(
"701.dynctx", "coverage==7.0.1", [("dynamic_context", "test_function")]
),
Coverage("702", "coverage==7.0.2"),
Coverage(
"702.dynctx", "coverage==7.0.2", [("dynamic_context", "test_function")]
),
],
projects=[
EmptyProject("empty", [1.2, 3.4]),
EmptyProject("dummy", [6.9, 7.1]),
],
rows=["proj", "pyver"],
column="cov",
ratios=[
(".2 vs .1", "702", "701"),
(".1 dynctx cost", "701.dynctx", "701"),
(".2 dynctx cost", "702.dynctx", "702"),
],
)
54 changes: 54 additions & 0 deletions lab/benchmark/run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from benchmark import *

if 0:
run_experiment(
py_versions=[
# Python(3, 11),
AdHocPython("/usr/local/cpython/v3.10.5", "v3.10.5"),
AdHocPython("/usr/local/cpython/v3.11.0b3", "v3.11.0b3"),
AdHocPython("/usr/local/cpython/94231", "94231"),
],
cov_versions=[
Coverage("6.4.1", "coverage==6.4.1"),
],
projects=[
AdHocProject("/src/bugs/bug1339/bug1339.py"),
SlipcoverBenchmark("bm_sudoku.py"),
SlipcoverBenchmark("bm_spectral_norm.py"),
],
rows=["cov", "proj"],
column="pyver",
ratios=[
("3.11b3 vs 3.10", "v3.11.0b3", "v3.10.5"),
("94231 vs 3.10", "94231", "v3.10.5"),
],
)


if 1:
run_experiment(
py_versions=[
Python(3, 9),
Python(3, 11),
],
cov_versions=[
Coverage("701", "coverage==7.0.1"),
Coverage(
"701.dynctx", "coverage==7.0.1", [("dynamic_context", "test_function")]
),
Coverage("702", "coverage==7.0.2"),
Coverage(
"702.dynctx", "coverage==7.0.2", [("dynamic_context", "test_function")]
),
],
projects=[
ProjectAttrs(),
],
rows=["proj", "pyver"],
column="cov",
ratios=[
(".2 vs .1", "702", "701"),
(".1 dynctx cost", "701.dynctx", "701"),
(".2 dynctx cost", "702.dynctx", "702"),
],
)

0 comments on commit 2fa45d6

Please sign in to comment.