ASV Runner

0.2.1 · active · verified Wed Apr 15

ASV Runner is the pure Python core of ASV (Airspeed-Velocity), providing essential functionality for running Python benchmarks with minimal dependencies. It focuses on the execution, timing, and memory measurement of benchmark code. The library's current version is 0.2.1, and it typically releases updates a few times a year, often in conjunction with the main `asv` package.

Common errors

Warnings

Install

Imports

Quickstart

ASV Runner provides the core logic for executing benchmarks. In a typical setup, users define benchmark functions or classes within Python files (e.g., `benchmarks.py`) which are then discovered and run by the `asv` command-line tool. This example demonstrates a simple benchmark suite that `asv` (using `asv-runner` internally) would execute.

# my_project/benchmarks.py
class TimeSuite:
    def setup(self):
        self.data = list(range(1_000_000))

    def time_iterate_list(self):
        for _ in self.data:
            pass

    def time_sum_list(self):
        sum(self.data)

# To run this, you would typically use the `asv` command-line tool:
# 1. Initialize an ASV project: `asv quickstart` (creates asv.conf.json, etc.)
# 2. Place this file in your benchmark directory (e.g., 'benchmarks/')
# 3. Run benchmarks: `asv run`

view raw JSON →