Skip to content

Add CodSpeed performance benchmarks and CI workflow#141

Merged
ifduyue merged 4 commits intomasterfrom
codspeed-wizard-1777179228332
Apr 26, 2026
Merged

Add CodSpeed performance benchmarks and CI workflow#141
ifduyue merged 4 commits intomasterfrom
codspeed-wizard-1777179228332

Conversation

@codspeed-hq
Copy link
Copy Markdown
Contributor

@codspeed-hq codspeed-hq Bot commented Apr 26, 2026

This PR integrates CodSpeed for continuous performance tracking of python-xxhash.

Changes

Benchmark suite (tests/test_benchmark.py)

16 benchmarks using pytest-codspeed, modeled after the existing bench.sh patterns. Coverage includes:

  • Oneshot functions: xxh32_intdigest, xxh64_intdigest, xxh3_64_intdigest, xxh3_128_intdigest
  • Streaming API: xxh32, xxh64, xxh3_64, xxh3_128 (construct, update, intdigest)
  • Data sizes: 1KB and 10KB payloads for each algorithm

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

A GitHub Actions workflow that runs benchmarks on every push to master, on pull requests, and supports workflow_dispatch for CodSpeed backtesting. Uses OIDC authentication and simulation mode for reproducible measurements.

README badge

Added a CodSpeed badge to the README alongside existing badges.

Note on runners

This repository belongs to a personal GitHub account, so the workflow uses standard ubuntu-latest runners instead of CodSpeed's dedicated codspeed-macro runners (which are only available to organization repositories). This means walltime measurements in CI will have higher variance than with bare-metal runners. Since this setup uses simulation mode, this is not a concern -- simulation measurements are deterministic regardless of the runner. See the walltime docs for more details.

Next steps

  1. Merge this PR to start collecting baseline performance data on master.
  2. CodSpeed will automatically report performance changes on future pull requests.
  3. Visit the CodSpeed dashboard to explore benchmark results and flame graphs.

@codspeed-hq
Copy link
Copy Markdown
Contributor Author

codspeed-hq Bot commented Apr 26, 2026

Congrats! CodSpeed is installed 🎉

🆕 96 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


ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.


Open in CodSpeed

@codspeed-hq codspeed-hq Bot marked this pull request as ready for review April 26, 2026 04:59
@ifduyue
Copy link
Copy Markdown
Owner

ifduyue commented Apr 26, 2026

ERROR: test_benchmark (unittest.loader._FailedTest)

ImportError: Failed to import test module: test_benchmark
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/unittest/loader.py", line 436, in _find_test_path
module = self._get_module_from_name(name)
File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/unittest/loader.py", line 377, in _get_module_from_name
import(name)
File "/home/runner/work/python-xxhash/python-xxhash/tests/test_benchmark.py", line 4, in
import pytest
ModuleNotFoundError: No module named 'pytest'

@ifduyue ifduyue merged commit 2bcd375 into master Apr 26, 2026
43 checks passed
@ifduyue ifduyue deleted the codspeed-wizard-1777179228332 branch April 26, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant