Skip to content

Add CodSpeed performance benchmarks and CI workflow#62

Open
codspeed-hq[bot] wants to merge 1 commit into
devfrom
codspeed-wizard-1774561068316
Open

Add CodSpeed performance benchmarks and CI workflow#62
codspeed-hq[bot] wants to merge 1 commit into
devfrom
codspeed-wizard-1774561068316

Conversation

@codspeed-hq
Copy link
Copy Markdown

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

Summary

This PR integrates CodSpeed for continuous performance monitoring of spaghettree's core algorithms.

Changes

  • Benchmark suite (tests/test_benchmarks.py): 12 benchmarks covering the performance-critical paths:
    • get_dwm (directed weighted modularity) at small, medium, and large matrix scales
    • AdjMat.from_call_tree construction
    • Merge pair detection (get_merge_pairs, get_top_suggested_merges)
    • Full community optimisation pipeline (optimise_communities)
    • CST parsing pipeline: entity extraction, non-native call filtering, and call tree creation
  • CI workflow (.github/workflows/codspeed.yml): Runs benchmarks in simulation mode on pushes to main, pull requests, and manual dispatch. Uses OIDC authentication.
  • pytest-codspeed added as a dev dependency.
  • CodSpeed badge added to the README.

Notes

  • The repo-mapper-rs dev dependency fails to build in current environments (broken maturin config in the published package). The CI workflow and benchmark runs exclude it via --no-install-package repo-mapper-rs since it is not needed for benchmarking.
  • Benchmarks override the default pytest addopts (coverage settings) to avoid failing on coverage thresholds, which are not relevant for performance runs.

Next steps

  • Once merged, CodSpeed will automatically track performance on every PR and push to main.
  • Visit the CodSpeed dashboard to view flamegraphs and performance trends.
  • Consider adding benchmarks for the full optimise_entity_positions pipeline as the project grows.

@codspeed-hq
Copy link
Copy Markdown
Author

codspeed-hq Bot commented Mar 26, 2026

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 March 26, 2026 21:44
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.

0 participants