Skip to content

Add CodSpeed integration for continuous performance testing#1

Draft
codspeed-hq[bot] wants to merge 17 commits intomainfrom
setup-codspeed-1769432486401
Draft

Add CodSpeed integration for continuous performance testing#1
codspeed-hq[bot] wants to merge 17 commits intomainfrom
setup-codspeed-1769432486401

Conversation

@codspeed-hq
Copy link

@codspeed-hq codspeed-hq bot commented Jan 26, 2026

Summary

This PR integrates CodSpeed to enable continuous performance testing in CI, providing reproducible performance measurements without environmental noise.

Changes Made

  • Dependencies: Added pytest-codspeed to test dependencies in pyproject.toml and requirements files
  • Benchmarks: Created pytest-codspeed compatible benchmarks in the bench/ directory:
    • test_variable_bench.py: Variable operations (copy, arithmetic) and numpy assignment benchmarks
    • test_bin_bench.py: Binning and grouping operation benchmarks with various parameter combinations
    • test_binned_bench.py: Binned data operations (constituents, size, sum, mean, concat) and lookup benchmarks
  • CI Workflow: Added .github/workflows/codspeed.yml with:
    • OIDC authentication for secure run submission
    • Simulation mode for consistent measurements
    • Integration with existing cmake and conda build process
  • Documentation: Added CodSpeed badge to README.md

Benchmark Coverage

The new benchmarks maintain the same coverage as the existing ASV benchmarks while being compatible with pytest-codspeed:

  • Variable shallow/deep copy operations
  • Variable arithmetic operations (in-place and non-in-place)
  • Numpy array assignment with various sizes (10^5 to 10^7 elements)
  • 2D binning operations with different bin counts
  • 1D binning of large tables (50M events)
  • Grouping operations with varying event counts and group sizes
  • Binned data operations (constituents, size, sum, mean, concat)
  • Lookup operations with different data types (bool, int64, float64)

Why CodSpeed?

CodSpeed provides several advantages over traditional benchmarking:

  • Reproducible measurements: Uses CPU simulation to eliminate environmental noise
  • CI integration: Automatically runs on every PR and commit to main
  • Performance regression detection: Catches performance issues before they reach production
  • Detailed profiling: Provides flame graphs and execution profiles for debugging

Test Plan

  • Verify the CodSpeed workflow runs successfully
  • Confirm benchmarks execute without errors
  • Check that the CodSpeed installation comment is posted on the PR
  • Review initial benchmark results on the CodSpeed dashboard

codspeed-hq bot and others added 15 commits January 26, 2026 13:05
This commit integrates CodSpeed to enable continuous performance testing:

- Added pytest-codspeed to test dependencies (pyproject.toml, requirements/test.in, requirements/test.txt)
- Created pytest-codspeed compatible benchmarks in bench/ directory:
  - test_variable_bench.py: Variable operations and numpy assignment benchmarks
  - test_bin_bench.py: Binning and grouping operation benchmarks
  - test_binned_bench.py: Binned data operations and lookup benchmarks
- Added GitHub Actions workflow (.github/workflows/codspeed.yml) with:
  - OIDC authentication for secure run submission
  - Simulation mode for consistent performance measurements
  - Integration with existing build process using cmake and conda
- Added CodSpeed badge to README.md linking to project dashboard

The benchmarks were converted from the existing ASV benchmarks while 
maintaining the same functionality and coverage. CodSpeed will provide 
reproducible performance measurements in CI without environmental noise.
Set CONDA_FORGE_BUILD and GIT_VERSION_INFO environment variables to
provide a fallback version for CMake builds when git tags are not
available.
CMake needs CONDA_FORGE_BUILD as a cache variable (-D flag) rather than
an environment variable to properly detect and use the GIT_VERSION_INFO
environment variable for version detection.
Changed GIT_VERSION_INFO from '0.0.0.dev0' to '0.0.0' as CMake's
project() VERSION only accepts numeric version components.
Changed the shell used in the workflow from bash to micromamba-shell.
Updated shell configuration and benchmark run command to use micromamba activation.
Updated the build step for scipp to include dependency setup and installation of test dependencies.
Removed GIT_VERSION_INFO environment variable.
Comment out the OptimizeWarning suppression in pyproject.toml.
@codspeed-hq
Copy link
Author

codspeed-hq bot commented Jan 27, 2026

Congrats! CodSpeed is installed 🎉

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

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