Skip to content

Commit

Permalink
- renamed coveragepy results, making "coveragepy" and
Browse files Browse the repository at this point in the history
  "coveragepy-branch" the results obtained with the default settings,
  as before, and marking those where we request the new sys.monitoring
  use as "...-sysmon", hoping that this will be clearer;

- made bar labels optional in summary plot;
  • Loading branch information
jaltmayerpizzorno committed May 6, 2024
1 parent 2122aec commit cb72f74
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions benchmarks/benchmarks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5586,7 +5586,7 @@
]
}
},
"coveragepy": {
"coveragepy-sysmon": {
"flask": {
"datetime": "2024-04-16T12:43:03.225058",
"version": "7.4.4",
Expand Down Expand Up @@ -5684,7 +5684,7 @@
"coveragepy_version": "7.4.4"
}
},
"coveragepy-branch": {
"coveragepy-branch-sysmon": {
"flask": {
"datetime": "2024-04-16T12:51:55.068895",
"version": "7.4.4",
Expand Down Expand Up @@ -5954,7 +5954,7 @@
]
}
},
"coveragepy-branch-nosysmon": {
"coveragepy-branch": {
"flask": {
"datetime": "2024-04-16T16:00:47.736998",
"version": "7.4.4",
Expand Down Expand Up @@ -6046,4 +6046,4 @@
}
}
}
]
]
16 changes: 10 additions & 6 deletions benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,19 @@ def __init__(self, name, label, command, color=None, get_version=None, env=None)
return [Case('base', "(no coverage)",
sys.executable + " {bench_command}"),
Case('coveragepy', "coverage.py line",
sys.executable + " -m coverage run {coveragepy_opts} {bench_command}",
color='orange', get_version=lambda: version('coverage')),
Case('coveragepy-sysmon', "coverage.py line",
sys.executable + " -m coverage run {coveragepy_opts} {bench_command}",
color='orange', get_version=lambda: version('coverage'),
env={'COVERAGE_CORE':'sysmon'}),
Case('coveragepy-branch', "coverage.py line+branch",
Case('coveragepy-branch', "coverage.py line+branch, no sysmon",
sys.executable + " -m coverage run --branch {coveragepy_opts} {bench_command}",
color='tab:orange', get_version=lambda: version('coverage')),
Case('coveragepy-branch-sysmon', "coverage.py line+branch",
sys.executable + " -m coverage run --branch {coveragepy_opts} {bench_command}",
color='tab:orange', get_version=lambda: version('coverage'),
env={'COVERAGE_CORE':'sysmon'}),
Case('coveragepy-branch-nosysmon', "coverage.py line+branch, no sysmon",
sys.executable + " -m coverage run --branch {coveragepy_opts} {bench_command}",
color='yellow', get_version=lambda: version('coverage')),
Case('nulltracer', "null C tracer",
sys.executable + " -m nulltracer {nulltracer_opts} {bench_command}",
color='tab:red', get_version=lambda: version('nulltracer')),
Expand Down Expand Up @@ -176,7 +179,7 @@ def parse_args():
p.add_argument('--style', type=str, help='set matplotlib style')
p.add_argument('--figure-width', type=float, default=16, help='matplotlib figure width')
p.add_argument('--figure-height', type=float, default=8, help='matplotlib figure height')
p.add_argument('--bar-labels', action='store_true', help='add labels to bars')
p.add_argument('--bar-labels', action=argparse.BooleanOptionalAction, help='add labels to bars')
p.add_argument('--font-size-delta', type=int, default=0, help='increase or decrease font size')
p.add_argument('--rename-slipcover', type=str, help='rename SlipCover in names to given string')
p.add_argument('--yscale', type=str, default="linear", help='set matplotlib Y scale')
Expand Down Expand Up @@ -519,7 +522,8 @@ def getValue(caseName, benchName):
data = [median([getValue(c, b.name) for b in benchmarks if b.name in common_benchmarks]) for c in args.case]
x = args.case_name if args.case_name else args.case
bp = ax.bar(x, data, color=[c.color for cn in args.case for c in cases if c.name == cn])
ax.bar_label(bp, labels=[f'{v:,.0f} %' for v in data])
if args.bar_labels:
ax.bar_label(bp, labels=[f'{v:,.0f} %' for v in data])
# ax.set_xticklabels(args.case)

if args.extra_space:
Expand Down

0 comments on commit cb72f74

Please sign in to comment.