Skip to content

test: add benchmarks - #6728

Merged
benjamincanac merged 7 commits into
v4from
perf/benchmarks
Jul 15, 2026
Merged

benjamincanac merged 7 commits into
v4from
perf/benchmarks

Conversation

@benjamincanac

@benjamincanac benjamincanac commented Jul 14, 2026 •

Copy link
Copy Markdown
Member

❓ Type of change

  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)

📚 Description

Adds a benchmark suite (test/bench/) covering the tv() factory build vs invocation, slot invocation, and component mount/re-render.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pkg-pr-new

pkg-pr-new Bot commented Jul 14, 2026 •

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

commit: 645065d

@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a bench npm script and configures Vitest to discover benchmarks only in the Vue project. Adds component benchmarks for Toolbar, Button, and Table mounting and re-rendering. Adds tv benchmarks covering factory construction, invocation patterns, and repeated table slot calls.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the new benchmark additions.
Description check ✅ Passed The description matches the changeset by describing the added benchmark suite and covered areas.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/benchmarks

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
test/bench/tv.bench.ts (1)

59-61: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove ephemeral PR references from comments.

Referencing specific PR numbers (like "PR 2" and "PR 3") in code comments becomes stale and loses context over time once the code is merged. It is generally better practice to describe the architectural goal or the specific optimization being measured.

  • test/bench/tv.bench.ts#L59-L61: Update the comment to explain the optimization directly (e.g., the overhead saved by hoisting the factory build out of the variant-prop computed) instead of referencing PR 2.
  • test/bench/tv.bench.ts#L72-L74: Update the comment to describe the performance overhead targets (wrapper closure allocation and replacer scan) directly instead of referencing PR 3.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/bench/tv.bench.ts` around lines 59 - 61, Remove the ephemeral PR
references from the benchmark comments in test/bench/tv.bench.ts: update lines
59-61 to describe the overhead saved by hoisting factory construction out of the
variant-prop recomputation, and update lines 72-74 to describe the targeted
wrapper-closure allocation and replacer-scan overhead directly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/benchmark.yml:
- Around line 25-35: Update the “Checkout” step using actions/checkout@v7 to set
persist-credentials to false, leaving the remaining workflow steps unchanged.

In `@test/bench/components.bench.ts`:
- Around line 26-30: Update the “toggle loading” benchmark to perform a
deterministic full state cycle on every iteration: set loading to true, await
wrapper.setProps, then set it to false and await wrapper.setProps again. Ensure
each iteration ends in the initial false state instead of relying on the shared
loading toggle.

---

Nitpick comments:
In `@test/bench/tv.bench.ts`:
- Around line 59-61: Remove the ephemeral PR references from the benchmark
comments in test/bench/tv.bench.ts: update lines 59-61 to describe the overhead
saved by hoisting factory construction out of the variant-prop recomputation,
and update lines 72-74 to describe the targeted wrapper-closure allocation and
replacer-scan overhead directly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0e37f29e-3bbb-4182-b2f7-9c0264d0070d

📥 Commits

Reviewing files that changed from the base of the PR and between f951529 and d29069d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • .github/workflows/benchmark.yml
  • package.json
  • test/bench/components.bench.ts
  • test/bench/tv.bench.ts
  • vitest.config.ts

Comment thread .github/workflows/benchmark.yml Outdated
Comment thread test/bench/components.bench.ts Outdated
@benjamincanac benjamincanac changed the title test: add benchmarks with CodSpeed CI test: add benchmarks Jul 15, 2026
@benjamincanac
benjamincanac merged commit f546b2c into v4 Jul 15, 2026
24 checks passed
@benjamincanac
benjamincanac deleted the perf/benchmarks branch July 15, 2026 08:48

This branch was successfully deployed

1 active deployment
Preview – ui — 645065d9 Deployed Jul 15, 2026 by vercel[bot]
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.

1 participant