Airspeed Velocity (ASV)

0.6.5 · active · verified Wed Apr 15

Airspeed Velocity (asv) is a tool for benchmarking Python packages over their lifetime. It is primarily designed to benchmark a single project over its lifetime using a given suite of benchmarks. The results are displayed in an interactive web frontend that requires only a basic static webserver to host. The current version is 0.6.5, released in September 2025, and it maintains a relatively active release cadence with several updates per year.

Common errors

Warnings

Install

Imports

Quickstart

To get started, navigate to your project directory (or a new directory for benchmarks) and run `asv quickstart` to set up the basic configuration and an example benchmark file. Then, define your benchmarks in Python files within the `benchmarks/` directory, typically as classes with `time_` or `mem_` prefixed methods. Finally, execute `asv run` to collect benchmark data and `asv publish` to generate the interactive web report, which can be viewed with `asv browse`.

# 1. Initialize a new ASV benchmark suite
# Run this in your project's root or a dedicated benchmark directory.
asv quickstart

# 2. Add a benchmark to benchmarks/benchmarks.py (example content below)
# Create or edit 'benchmarks/benchmarks.py' with content like:
# import numpy as np
# 
# class TimeSuite:
#     def setup(self):
#         self.x = np.random.rand(1000, 1000)
# 
#     def time_sum_array(self):
#         np.sum(self.x)
# 
#     def time_dot_product(self):
#         np.dot(self.x, self.x)
# 
#     def teardown(self):
#         self.x = None
# 
# class MemSuite:
#     def mem_full_array(self):
#         return np.random.rand(1000, 1000)

# 3. Run the benchmarks
asv run

# 4. Publish the results to a web frontend
asv publish

# 5. Open the results in a web browser
asv browse

view raw JSON →