Skip to content

Add CodSpeed performance benchmarks and CI integration#775

Draft
codspeed-hq[bot] wants to merge 3 commits into
mainfrom
codspeed/wizard-1780669955511
Draft

Add CodSpeed performance benchmarks and CI integration#775
codspeed-hq[bot] wants to merge 3 commits into
mainfrom
codspeed/wizard-1780669955511

Conversation

@codspeed-hq

@codspeed-hq codspeed-hq Bot commented Jun 5, 2026

Copy link
Copy Markdown

Summary

This PR sets up CodSpeed continuous performance testing for starlette-admin. It adds a suite of benchmarks covering the most frequently exercised, CPU-bound code paths and wires up a GitHub Actions workflow to run them on every push and pull request.

Changes

  • benchmarks/test_benchmarks.py — 10 pytest-codspeed benchmarks targeting pure-CPU, deterministic code paths that need no database, network or event loop:
    • helpers: prettify_class_name, slugify_class_name, get_file_icon, html_params, extract_fields
    • fields: field construction, StringField.input_params, BaseField.dict() serialization
    • converters: StandardModelConverter.convert_fields_list and converter lookup
  • .github/workflows/codspeed.yml — GitHub Actions workflow running the benchmarks with CodSpeedHQ/action@v4 in simulation mode, authenticated via OpenID Connect (no token required).
  • README.md — Added the CodSpeed badge.

Notes

  • The benchmarks use the CPU simulation instrument (the default for Python), which provides hardware-agnostic, low-variance measurements and automatic flamegraphs.
  • The workflow installs the package together with pytest and pytest-codspeed, keeping the benchmark job lightweight and independent from the heavier ORM test matrix.
  • All benchmarks were verified locally in simulation mode and pass the repository's ruff and black checks.

Next steps

  • Once merged, CodSpeed will establish a performance baseline from the main branch and report deltas on subsequent pull requests.
  • Additional benchmarks can be added over time to cover more code paths (e.g. async serialization, ORM-specific converters) as needed.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request June 5, 2026 14:38 Inactive
@codspeed-hq codspeed-hq Bot force-pushed the codspeed/wizard-1780669955511 branch from a95b692 to 2280850 Compare June 5, 2026 14:41
@github-actions github-actions Bot temporarily deployed to pull request June 5, 2026 14:42 Inactive
@codspeed-hq

codspeed-hq Bot commented Jun 5, 2026

Copy link
Copy Markdown
Author

Congrats! CodSpeed is installed 🎉

🆕 10 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 June 5, 2026 14:42
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e4868ce) to head (2280850).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #775   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           86        86           
  Lines         6848      6848           
=========================================
  Hits          6848      6848           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jowilf jowilf marked this pull request as draft June 11, 2026 05:26
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