ci: add CodSpeed performance benchmarks - #6732
Closed
codspeed-hq[bot] wants to merge 1 commit into
Closed
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Author
Congrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
commit: |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-pluginadded as a dev dependency (lockfile updated withpnpm).vitest.bench.config.ts: a dedicated Vitest config for benchmarks that registers the CodSpeed plugin and picks upbench/**/*.bench.ts. It is kept separate from the mainvitest.config.tsso the Nuxt/happy-dom test projects are untouched.bench/benchmarks covering pure, hot-path utilities:bench/utils.bench.ts—get,set,pick,omit,compare,isEmpty,getDisplayValue,mergeClasses,transformUI,resolveBaseURLbench/search.bench.ts—sanitizeSnippetandhighlightbench/content.bench.ts—mapContentNavigation(flat, deeply nested, depth-limited)benchscript inpackage.json:vitest bench --run --config vitest.bench.config.ts..github/workflows/codspeed.yml): runs onpush/pull_requesttargetingv4and onworkflow_dispatch. It mirrors the existingmodule.ymlsetup (pnpm, Node 22,pnpm run dev:prepare) and runs benchmarks throughCodSpeedHQ/action@v4insimulationmode using OIDC authentication.Notes
ubuntu-latest.pnpm run dev:prepareis required before benchmarking because the roottsconfig.jsonextends the generated.nuxt/tsconfig.json; the workflow runs it as an explicit step, matching the existing test workflow.codspeed run --mode simulation -- pnpm bench— all 24 benchmarks execute and report successfully.Next steps
*.bench.tsfiles intobench/.