python-performance-test

Compare pytest-benchmark execution metrics against a committed statistical baseline to gate Python performance regressions.

1|Updated Jun 20, 2026
One-click install
npx skills add https://github.com/shafibabar/SDLC-Artifact-Factory --skill python-performance-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-performance-test
Source: https://github.com/shafibabar/SDLC-Artifact-Factory/tree/main/skills/python-performance-test
Command: npx skills add https://github.com/shafibabar/SDLC-Artifact-Factory --skill python-performance-test

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, pytest-benchmark, orjson, and includes references (resource) components.

What problem does it solve?

This skill prevents performance regressions in Python code by establishing a committed statistical baseline and enforcing a CI gate that fails builds when performance degrades beyond a defined threshold.

Core Features & Use Cases

  • Statistical Regression Gating: Uses pytest-benchmark to compare current performance against a committed baseline, failing CI if the median execution time regresses by more than 12%.
  • In-Process Micro-benchmarking: Provides a framework for benchmarking hot pure functions, serialization paths, and handler logic without the noise of network I/O.
  • Use Case: A backend engineer modifies a data serialization function. Before merging, the CI job runs the performance gate, detects a 15% slowdown compared to the committed baseline, and blocks the PR until the performance is optimized or the baseline is updated.

Quick Start

Run the python-performance-test skill to initialize a new benchmark file in the tests/benchmarks directory and configure the dedicated CI regression gate.

Frequently Asked Questions about python-performance-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent Python performance regressions in CI?

You can prevent Python performance regressions by establishing a committed statistical baseline and enforcing a CI gate that fails builds when median execution time degrades beyond a defined threshold.

How do I benchmark CPU-bound Python functions with pytest?

You can benchmark CPU-bound Python functions using pytest-benchmark to execute multi-round sweeps on hot paths like serialization and domain logic, capturing median execution times without network I/O noise.

Does pytest-benchmark support automated regression thresholds for pull requests?

Yes, pytest-benchmark supports automated regression thresholds by comparing current execution metrics against a committed statistical baseline to block pull requests when performance degrades beyond a 12% threshold.

What is the best way to gate Python serialization performance in continuous integration?

The best way to gate Python serialization performance is to run in-process micro-benchmarks in a dedicated CI environment, comparing median latency against a committed baseline to block merging if regressions exceed 12%.

Do I need a dedicated CI environment to run Python performance benchmarks?

Yes, you need a dedicated CI environment to execute multi-round benchmark sweeps and enforce median-based latency thresholds, ensuring consistent statistical comparisons for performance regression gating.