Skip to content

Add CodSpeed performance benchmarks#486

Merged
miketheman merged 2 commits into
mainfrom
codspeed-wizard-1779383188315
May 21, 2026
Merged

Add CodSpeed performance benchmarks#486
miketheman merged 2 commits into
mainfrom
codspeed-wizard-1779383188315

Conversation

@codspeed-hq

@codspeed-hq codspeed-hq Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR integrates CodSpeed for continuous performance tracking of pytest-socket's core utility functions.

Changes

Benchmark tests (tests/test_benchmarks.py)

12 benchmarks covering the plugin's hot paths:

  • is_ipaddress -- IPv4, IPv6, and invalid address validation
  • host_from_address / host_from_connect_args -- host extraction from socket address tuples and Unix socket paths
  • _partition_allowed -- splitting allow-lists into plain hosts vs. CIDR networks (small, mixed, and large inputs)
  • normalize_allowed_hosts -- resolving and normalizing host allow-lists, with and without a resolution cache
  • disable_socket / enable_socket -- the core socket-patching cycle

CI workflow (.github/workflows/codspeed.yml)

  • Runs on push to main, on pull requests, and on workflow_dispatch (for CodSpeed backtests)
  • Uses simulation mode for deterministic, low-variance measurements
  • Follows the existing workflow conventions (commit-hash pinning, uv, concurrency groups)

Other

  • Added pytest-codspeed to the dev dependency group
  • Added CodSpeed badge to README.md

Next steps

  1. Merge this PR to establish the baseline measurements on main.
  2. After the first run on main, CodSpeed will automatically report performance changes on future pull requests.
  3. Visit the CodSpeed dashboard to explore flamegraphs and detailed metrics.

codspeed-hq Bot and others added 2 commits May 21, 2026 17:11
@codspeed-hq

codspeed-hq Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

Congrats! CodSpeed is installed 🎉

🆕 12 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks


Open in CodSpeed

@miketheman miketheman marked this pull request as ready for review May 21, 2026 17:24
@miketheman miketheman merged commit 0cf1742 into main May 21, 2026
29 checks passed
@miketheman miketheman deleted the codspeed-wizard-1779383188315 branch May 21, 2026 17:24
@miketheman miketheman added chore General maintenance items github_actions Pull requests that update GitHub Actions code labels May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore General maintenance items github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant