Skip to content

Add CodSpeed performance benchmarks for Rust domain layer#143

Merged
mpiton merged 4 commits intomainfrom
codspeed-wizard-1777816068872
May 3, 2026
Merged

Add CodSpeed performance benchmarks for Rust domain layer#143
mpiton merged 4 commits intomainfrom
codspeed-wizard-1777816068872

Conversation

@codspeed-hq
Copy link
Copy Markdown
Contributor

@codspeed-hq codspeed-hq Bot commented May 3, 2026

What this PR does

Integrates CodSpeed continuous performance tracking into the Vortex project, benchmarking the Rust domain layer — the pure business logic at the core of the application.

Benchmarks added

22 benchmarks across 7 groups covering the critical domain model operations:

Group Benchmarks What's measured
url_parsing 4 HTTPS, complex URLs with ports/query params, userinfo, FTP scheme
download_state_machine 5 Creation, full lifecycle, retry cycles, progress calculation, checksum workflow
segment_operations 4 Creation, full lifecycle, segment splitting, error/reset cycles
checksum_detection 3 SHA-256 detection, MD5 detection, invalid input rejection
link_status 3 HTTP status code mapping (200, 404, 500)
config_operations 5 Default creation, single/multi-field patching, normalization functions
priority 2 Valid and invalid priority creation

Why the domain layer?

The domain layer (src-tauri/src/domain/model/) implements core business logic with zero external dependencies — making it ideal for deterministic CPU simulation benchmarks. These operations are called on every download interaction, so regressions here directly impact user experience.

Changes

  • src-tauri/benches/domain_benchmarks.rs — Criterion benchmark suite with CodSpeed compatibility
  • src-tauri/Cargo.toml — Added codspeed-criterion-compat dev dependency and bench target
  • .github/workflows/codspeed.yml — GitHub Actions workflow for continuous performance tracking (simulation mode, OIDC auth)
  • README.md — Added CodSpeed performance badge

How it works

CodSpeed runs benchmarks in simulation mode, using CPU instruction counting for deterministic, reproducible measurements with <1% variance — no need for dedicated hardware. The GitHub Actions workflow runs on every push to main and on pull requests, providing automatic performance regression detection.


Summary by cubic

Adds CodSpeed benchmarks for the Rust domain layer, with a CI workflow that runs on pushes and PRs to catch performance regressions. Adds a README badge and CHANGELOG entry; benches run from src-tauri.

  • New Features

    • Benchmark suite at src-tauri/benches/domain_benchmarks.rs using codspeed-criterion-compat.
    • 26 benchmarks across 7 groups: url_parsing, download_state_machine, segment_operations, checksum_detection, link_status, config_operations, priority.
    • GitHub Actions workflow runs CodSpeed in simulation mode on main and PRs; builds and runs via cargo-codspeed from src-tauri. Adds README badge and updates CHANGELOG.
    • Adds dev dependency criterion (package codspeed-criterion-compat) and a bench target (domain_benchmarks) in Cargo.toml.
  • Bug Fixes

    • CI uses job working-directory and runs benches from src-tauri, fixing cargo-codspeed execution.
    • Applied rustfmt and reordered Criterion imports to match 2024 edition rules.

Written for commit c3a7733. Summary will update on new commits.

@github-actions github-actions Bot added documentation Improvements or additions to documentation ci dependencies rust labels May 3, 2026
@codspeed-hq codspeed-hq Bot force-pushed the codspeed-wizard-1777816068872 branch from 5f8b30a to a7fc863 Compare May 3, 2026 14:31
@codspeed-hq
Copy link
Copy Markdown
Contributor Author

codspeed-hq Bot commented May 3, 2026

Congrats! CodSpeed is installed 🎉

🆕 26 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 May 3, 2026 14:47
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

codspeed-hq Bot and others added 4 commits May 3, 2026 17:14
- Add criterion benchmarks with codspeed-criterion-compat for the domain model
- Cover URL parsing, download state machine, segment operations, checksum
  detection, link status, config operations, and priority creation
- Add GitHub Actions workflow for continuous performance tracking
- Add CodSpeed badge to README
Reorder criterion imports to match rustfmt 2024 edition rules.
Previous CI fix (a7fc863) missed the bench target.
Required by the "CHANGELOG updated" CI job — code changes (benches,
workflow, deps) need a matching [Unreleased] entry.
@mpiton mpiton force-pushed the codspeed-wizard-1777816068872 branch from ea16c1a to c3a7733 Compare May 3, 2026 15:18
@mpiton mpiton merged commit 9caa21b into main May 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci dependencies documentation Improvements or additions to documentation rust

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant