Skip to content

ci: add CodSpeed performance benchmarks - #6732

Closed
codspeed-hq[bot] wants to merge 1 commit into
v4from
codspeed/wizard-1784031676459
Closed

ci: add CodSpeed performance benchmarks#6732
codspeed-hq[bot] wants to merge 1 commit into
v4from
codspeed/wizard-1784031676459

Conversation

@codspeed-hq

@codspeed-hq codspeed-hq Bot commented Jul 14, 2026

Copy link
Copy Markdown

Summary

This PR sets up CodSpeed continuous performance measurement for Nuxt UI. It adds benchmarks for the framework-agnostic utility functions that power components (data access, comparison, search highlighting, and content navigation mapping) and wires them into CI so regressions are caught automatically on every pull request.

Changes

  • @codspeed/vitest-plugin added as a dev dependency (lockfile updated with pnpm).
  • vitest.bench.config.ts: a dedicated Vitest config for benchmarks that registers the CodSpeed plugin and picks up bench/**/*.bench.ts. It is kept separate from the main vitest.config.ts so the Nuxt/happy-dom test projects are untouched.
  • bench/ benchmarks covering pure, hot-path utilities:
    • bench/utils.bench.tsget, set, pick, omit, compare, isEmpty, getDisplayValue, mergeClasses, transformUI, resolveBaseURL
    • bench/search.bench.tssanitizeSnippet and highlight
    • bench/content.bench.tsmapContentNavigation (flat, deeply nested, depth-limited)
  • bench script in package.json: vitest bench --run --config vitest.bench.config.ts.
  • GitHub Actions workflow (.github/workflows/codspeed.yml): runs on push/pull_request targeting v4 and on workflow_dispatch. It mirrors the existing module.yml setup (pnpm, Node 22, pnpm run dev:prepare) and runs benchmarks through CodSpeedHQ/action@v4 in simulation mode using OIDC authentication.
  • README badge added for CodSpeed.

Notes

  • Simulation mode is used (the default for Node.js): deterministic, hardware-agnostic CPU measurement with low variance, suitable for these CPU-bound utility functions. It runs on ubuntu-latest.
  • pnpm run dev:prepare is required before benchmarking because the root tsconfig.json extends the generated .nuxt/tsconfig.json; the workflow runs it as an explicit step, matching the existing test workflow.
  • Benchmarks were verified locally with codspeed run --mode simulation -- pnpm bench — all 24 benchmarks execute and report successfully.

Next steps

  • Once merged, CodSpeed will start tracking these benchmarks and comment performance diffs on future PRs.
  • Additional benchmarks can be added by dropping new *.bench.ts files into bench/.

@github-actions github-actions Bot added the v4 #4488 label Jul 14, 2026
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​codspeed/​vitest-plugin@​5.7.1971009896100

View full report

@codspeed-hq

codspeed-hq Bot commented Jul 14, 2026

Copy link
Copy Markdown
Author

Congrats! CodSpeed is installed 🎉

🆕 24 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 July 14, 2026 12:30
@codspeed-hq
codspeed-hq Bot requested a review from benjamincanac as a code owner July 14, 2026 12:30
@pkg-pr-new

pkg-pr-new Bot commented Jul 14, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/ui@6732

commit: 5de2431

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants