# ionelmc/pytest-benchmark

pytest fixture for benchmarking code

Repository: https://github.com/ionelmc/pytest-benchmark
Canonical: https://ross.abutalabs.com/products/pytest-benchmark
Language: Python
License: BSD-2-Clause
License Family: permissive
Topics: python, pytest, benchmark, benchmarking, performance
Last push: 2026-08-23T17:45:05+00:00

## Health v2 (maintenance only)
Score: 88/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 67, longevity 100
- inputs: {"age_days": 4345, "days_push": 10, "days_rel": 9, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1447, forks 136 (observed 2026-08-28T04:04:45.387541+00:00)

## What it is
A pytest plugin that provides a benchmark fixture for measuring code performance within tests. It automatically calibrates test rounds to the chosen timer and integrates tightly with pytest's fixture system.

## Use cases
- benchmark python functions in pytest tests
- track performance regressions across test runs
- measure execution time of code snippets
- compare performance of different implementations
- store and compare benchmark results between commits
- add microbenchmarks to existing test suite

## When to choose
- you already use pytest and want benchmarks as part of your test suite
- you need calibrated, statistically sound timing rounds
- you want to save, compare, and histogram benchmark results over time

## When to avoid
- you need standalone benchmarking outside pytest (use timeit or pyperf)
- you benchmark GPU or highly concurrent workloads needing specialized harnesses
- your project does not use pytest

## Facets
- artifact type: plugin
- maturity: stable
- function: benchmarking, testing
- domain: testing, performance, developer-tools
- platform: python, cli, cross-platform
- tags: pytest-plugin, pytest-fixture, performance-measurement, microbenchmarking

## Member repositories
- ionelmc/pytest-benchmark (main) score 88

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:45.387541+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:36:06.593817+00:00, confidence not recorded.
  - readme: https://github.com/ionelmc/pytest-benchmark (fetched 2026-08-28T04:04:45.387541+00:00, sha c1477a7fc772)
  - registry_pypi: https://pypi.org/pypi/pytest-benchmark/json (fetched 2026-08-29T11:45:53.593898+00:00, sha 395196bd8355)
- Data as of 2026-08-30T08:39:29.467469+00:00.
