Add CodSpeed performance benchmarks#93
Conversation
Congrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #93 +/- ##
==========================================
- Coverage 91.38% 91.28% -0.10%
==========================================
Files 5 5
Lines 1079 1079
Branches 41 41
==========================================
- Hits 986 985 -1
- Misses 82 83 +1
Partials 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
This PR integrates CodSpeed for continuous performance monitoring of picows.
Changes
Benchmark suite (
tests/test_benchmarks.py): 6 benchmarks usingpytest-codspeedcovering the library's critical paths:CI workflow (
.github/workflows/codspeed.yml): GitHub Actions workflow that compiles the Cython extensions and runs benchmarks with CodSpeed's simulation instrument on every push tomasterand on pull requests.README badge: CodSpeed badge added to the badge section.
How it works
The benchmarks exercise the full WebSocket stack through loopback connections -- server creation, client handshake, frame building, sending, parsing, and echoing -- which captures the end-to-end performance characteristics of picows. URL parsing benchmarks cover the pure-Python entry point.
CodSpeed's simulation mode provides deterministic, low-variance measurements that are independent of CI runner hardware, making it reliable for detecting regressions.
Note on CI runners
Since this is a personal repository (not an organization),
codspeed-macrorunners are not available. The workflow uses standardubuntu-latestrunners. Performance variance will be higher than with dedicated macro runners. If the repository is moved to an organization in the future, switching to macro runners is recommended for more stable walltime measurements. See: https://codspeed.io/docs/instruments/walltime#usage-on-personal-github-accountsNext steps