Skip to content

Add CodSpeed performance benchmarking#86

Merged
nstarman merged 1 commit into
mainfrom
codspeed-wizard-1784726528302
Jul 22, 2026
Merged

Add CodSpeed performance benchmarking#86
nstarman merged 1 commit into
mainfrom
codspeed-wizard-1784726528302

Conversation

@codspeed-hq

@codspeed-hq codspeed-hq Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR sets up continuous performance measurement with CodSpeed for dataclassish.

It adds a benchmark suite covering the public multiple-dispatch API and wires up a GitHub Actions workflow so performance is measured automatically on every push to main and on pull requests.

Changes

  • benchmarks/test_benchmarks.py: A pytest-codspeed benchmark suite exercising the public API across the object types dataclassish supports:
    • Mapping dispatches: replace, asdict, field_items
    • Dataclass dispatches: replace, fields, asdict, astuple, get_field, field_keys, field_values, field_items
    • Converter-enabled dataclass construction (converters.dataclass / field with Optional and Unless)
  • .github/workflows/codspeed.yml: A CodSpeed workflow running in simulation mode. It authenticates via OpenID Connect (id-token: write), installs dependencies with uv, and runs the benchmarks with CodSpeedHQ/action. Actions are pinned by commit hash with version comments to match the existing workflow conventions.
  • pyproject.toml / uv.lock: Added pytest-codspeed to the test dependency group.
  • README.md: Added the CodSpeed badge.

Notes

  • The benchmarks live in a dedicated benchmarks/ directory so they are not picked up by the regular pytest test run (testpaths remains unchanged). The workflow invokes them explicitly with -p no:sybil to avoid collecting doctest/README fixtures.
  • The suite was validated locally with codspeed run --mode instrumentation and all 12 benchmarks were collected, executed, and uploaded successfully.

Next steps

  • Merge this PR so CodSpeed records a baseline on main.
  • Future PRs will automatically get a performance report comparing against that baseline.

@github-actions github-actions Bot added 🔧 Add / update configuration Add or update configuration files. 👷 Add / update CI build system Add or update CI build system. 📝 Add / update documentation Add or update documentation. labels Jul 22, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 22, 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

@codspeed-hq
codspeed-hq Bot marked this pull request as ready for review July 22, 2026 13:37
@codspeed-hq
codspeed-hq Bot requested a review from a team as a code owner July 22, 2026 13:37
@codspeed-hq
codspeed-hq Bot requested a review from nstarman July 22, 2026 13:38
@nstarman nstarman added this to the v0.10.0 milestone Jul 22, 2026
@nstarman
nstarman merged commit 9e1a677 into main Jul 22, 2026
23 checks passed
@nstarman
nstarman deleted the codspeed-wizard-1784726528302 branch July 22, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👷 Add / update CI build system Add or update CI build system. 🔧 Add / update configuration Add or update configuration files. 📝 Add / update documentation Add or update documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants