Skip to content

Commit 2889335

Browse files
author
Melody Wang
committed
add a config to get new comparison between default merge base vs nogil PR
1 parent c28e1b0 commit 2889335

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

bench_runner/result.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424

2525
from . import bases as mbases
26+
from . import config
2627
from . import flags as mflags
2728
from . import git
2829
from . import hpt
@@ -779,6 +780,23 @@ def track(it, *_args, **_kwargs):
779780
),
780781
)
781782

783+
Base_default_vs_PR_NOGIL = (
784+
config.get_bench_runner_config().get("comparisons_diff_flags", {}).get("Base_default_vs_PR_NOGIL", False)
785+
)
786+
787+
if Base_default_vs_PR_NOGIL:
788+
found_base_diff_flag_NOGIL = find_match(
789+
result,
790+
candidates,
791+
"base_vs_PR_NOGIL",
792+
lambda ref: (
793+
_merge_base.startswith(ref.cpython_hash)
794+
and ref.flags != result.flags
795+
and ref.flags == []
796+
and result.flags == ["NOGIL"]
797+
),
798+
)
799+
782800
if not found_base and result.fork == "python" and result.flags != []:
783801
# Compare builds with flags with builds with no flags
784802
find_match(

tests/data/bench_runner.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ markers = ["s", "s", "s", "^", ".", "."]
2525

2626
[publish_mirror]
2727
skip = false
28+
29+
[comparisons_diff_flags]
30+
Base_default_vs_PR_NOGIL = false

0 commit comments

Comments
 (0)