Skip to content

Commit e3504b0

Browse files
committed
test: benchmark tweaks
Though it didn't result in a runnable benchmark :(
1 parent 2e88d42 commit e3504b0

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

benchmark/README.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ for the table. There will be a row for each combination of the two dimensions.
5050
The `column` argument is the remaining dimension that is used to add columns to
5151
the table, one for each item in that dimension.
5252

53+
To run a benchmark, create a Python file with a run_experiment call in it.
54+
Many are in run.py, guarded by ``if 0:`` and ``if 1:`` clauses. In the
55+
benchmark directory, run your Python file. If you haven't provided the
56+
``num_runs`` argument to run_experiment, put the number of runs on the command
57+
line::
58+
59+
% cd benchmark
60+
% python3 run.py 3
61+
5362
For example::
5463

5564
run_experiment(

benchmark/benchmark.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,9 @@ def __init__(
823823
tweaks: TweaksType = None,
824824
env_vars: Env_VarsType = None,
825825
):
826+
# Check that it really is a coverage source directory.
826827
directory = file_must_exist(directory_name, "coverage directory")
828+
file_must_exist(str(directory / "igor.py"))
827829
super().__init__(
828830
slug=slug,
829831
pip_args=str(directory),

benchmark/run.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
],
7373
)
7474

75-
if 1:
75+
if 0:
7676
# Compare N Python versions
7777
vers = [10, 11, 12, 13]
7878
run_experiment(
@@ -93,12 +93,13 @@
9393
],
9494
)
9595

96-
if 0:
96+
if 1:
9797
# Compare sysmon on many projects
9898

9999
run_experiment(
100100
py_versions=[
101-
Python(3, 12),
101+
# Python(3, 12),
102+
AdHocPython("/usr/local/cpython", "main"),
102103
],
103104
cov_versions=[
104105
NoCoverage("nocov"),
@@ -107,14 +108,14 @@
107108
],
108109
projects=[
109110
# ProjectSphinx(), # Works, slow
110-
ProjectPygments(), # Works
111+
# ProjectPygments(), # Doesn't work on 3.14
111112
# ProjectRich(), # Doesn't work
112113
# ProjectTornado(), # Works, tests fail
113114
# ProjectDulwich(), # Works
114115
# ProjectBlack(), # Works, slow
115-
# ProjectMpmath(), # Works, slow
116-
ProjectMypy(), # Works, slow
117-
# ProjectHtml5lib(), # Works
116+
ProjectMpmath(), # Works, slow
117+
# ProjectMypy(), # Works, slow
118+
# ProjectHtml5lib(), # Doesn't work on 3.14
118119
# ProjectUrllib3(), # Works
119120
],
120121
rows=["pyver", "proj"],

0 commit comments

Comments
 (0)