Skip to content

Quickly exercise the benchmark architecture in all CI #5790

@trexfeathers

Description

@trexfeathers

📰 Custom Issue

#5776 introduced always benchmarking changes setup.py, not because the changes might influence performance, but because they might break the benchmarking altogether.

The smarter implementation would be to introduce another convenience to benchmarks/bm_runner.py that can go through a benchmark run without the long process of actually running the benchmarks. This could be run as part of standard CI on all pull requests to confirm that any changes have not fundamentally broken benchmarking.

Things that would need exercising:

So this basically means benchmarking two commits. ASV only works properly if running at least one benchmark, so we could perhaps introduce one to benchmarks/benchmarks/__init__ that uses artificial data generation to make a very small file then performs a very small operation in the benchmark itself.

Example command:

asv run --bench validate_bm_suite --quick <commits>

Populating <commits> would probably need similar logic to this:

with NamedTemporaryFile("w") as hashfile:
hashfile.writelines([merge_base, "\n", head_sha])
hashfile.flush()
commit_range = f"HASHFILE:{hashfile.name}"
asv_command = shlex.split(ASV_HARNESS.format(posargs=commit_range))
_subprocess_runner([*asv_command, *args.asv_args], asv=True)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions