Skip to content

The template for benchmarks/bm_runner.py has been updated #555

@scitools-ci

Description

@scitools-ci

The template for benchmarks/bm_runner.py has been updated; see the diff below. Please either:

  • Action this issue with a pull request applying some/all of these changes to benchmarks/bm_runner.py.
  • Close this issue if none of these changes are appropriate for this repo.

Also consider reviewing a full diff between the template and benchmarks/bm_runner.py, in case other valuable shared conventions have previously been missed.

File Links

Diff

diff --git a/templates/benchmarks/bm_runner.py b/templates/benchmarks/bm_runner.py
index cadc5ce..c94e28b 100755
--- a/templates/benchmarks/bm_runner.py
+++ b/templates/benchmarks/bm_runner.py
@@ -130,11 +130,21 @@ def _asv_compare(
 ) -> None:
     """Run through a list of commits comparing each one to the next."""
     commits = tuple(commit[:8] for commit in commits)
+
+    machine_script = [
+        "from asv.machine import Machine",
+        "print(Machine.get_unique_machine_name())",
+    ]
+    machine_name = _subprocess_runner_capture(
+        ["python", "-c", ";".join(machine_script)]
+    )
+
     for i in range(len(commits) - 1):
         before = commits[i]
         after = commits[i + 1]
         asv_command = shlex.split(
-            f"compare {before} {after} --factor={COMPARE_FACTOR} --split"
+            f"compare {before} {after} "
+            f"--machine {machine_name} --factor={COMPARE_FACTOR} --split"
         )
 
         comparison = _subprocess_runner_capture(asv_command, asv=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions