Skip to content

test: add bench cases#2787

Merged
HuJean merged 3 commits into
mainfrom
p/bench-transform
Jun 3, 2026
Merged

test: add bench cases#2787
HuJean merged 3 commits into
mainfrom
p/bench-transform

Conversation

@HuJean
Copy link
Copy Markdown
Collaborator

@HuJean HuJean commented Jun 3, 2026

Summary by CodeRabbit

  • Tests

    • Added two new React benchmark cases to evaluate performance across different runtime patterns.
  • Chores

    • Extended benchmark configuration and added npm scripts for running and profiling the new cases.
  • Documentation

    • Added/updated "System Prompts" guide (EN/ZH) and registered it in the website sidebar for both languages.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 3, 2026

⚠️ No Changeset found

Latest commit: f03548e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@HuJean HuJean marked this pull request as ready for review June 3, 2026 12:00
@HuJean HuJean requested a review from hzy as a code owner June 3, 2026 12:00
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Two new React benchmark cases are added: case 010 exercises exponentiation operator syntax variations (** and **=), while case 011 tests async-to-generator transformation with nested async function calls. Both are registered in the build configuration with corresponding execution scripts.

Changes

React Benchmark Cases: Exponentiation Operator and Async-to-Generator

Layer / File(s) Summary
Exponentiation operator benchmark (case 010)
benchmark/react/cases/010-transform-exponentiation-operator/fixture.js, benchmark/react/cases/010-transform-exponentiation-operator/index.tsx
Fixture iterates 500 times over multiple exponentiation forms (base ** 2, base ** 3, 2 ** base, x **= 2) when __BACKGROUND__ is active, accumulating results. React entry point renders the final result value and mounts RunBenchmarkUntilHydrate.
Async-to-generator benchmark (case 011)
benchmark/react/cases/011-transform-async-to-generator/fixture.js, benchmark/react/cases/011-transform-async-to-generator/index.tsx
Fixture defines async compute(x) returning x + 1 and async chain(n) that accumulates computed values. When __BACKGROUND__ is active, runs 50 iterations of await chain(10), aggregating results. React entry point renders the final result and hydration component.
Benchmark configuration and scripts
benchmark/react/lynx.config.js, benchmark/react/package.json
lynx.config.js registers both new benchmark entry points in source.entry. package.json adds bench:010-* and bench:011-* scripts to run the benchmarks, plus perfetto:010-* and perfetto:011-* scripts to generate performance profiling traces via benchx_cli.
GenUI docs update
packages/genui/a2ui/docs/system-prompts.md, packages/genui/a2ui/docs/system-prompts_zh.md
Rewrites a cross-reference in both English and Chinese system-prompts docs to point to catalog/manifest guidance (./catalog-guide_zh.md for zh).
Website sidebar and link mappings
website/sidebars/genui.ts
Adds system-prompts.md to sync steps, inserts “System Prompts” nav items for EN/ZH, and updates link replacement tables mapping docs to their stable guide URLs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • hzy
  • PupilTong
  • Sherry-hue

Poem

🐰 Two benchmarks hop into the den,
One counts exponents now and then,
The other chains async dreams,
Rendered small on hydration beams,
A tiny hop for perf-loving men!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'test: add bench cases' is vague and generic. While it references adding benchmark cases (which aligns with the changeset), it lacks specificity about what benchmarks are being added and doesn't clearly convey the primary changes (exponentiation operator and async-to-generator transforms). Consider using a more descriptive title like 'test: add benchmark cases for exponentiation operator and async-to-generator transform' to better communicate the specific benchmarks being introduced.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 p/bench-transform

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 and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 3, 2026

Merging this PR will not alter performance

✅ 83 untouched benchmarks
🆕 4 new benchmarks
⏩ 26 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 010-transform-exponentiation-operator/background.js_LoadScript N/A 1.3 ms N/A
🆕 011-transform-async-to-generator/background.js_LoadScript N/A 911.7 µs N/A
🆕 010-transform-exponentiation-operator/main-thread.js_LoadScript N/A 272.5 µs N/A
🆕 011-transform-async-to-generator/main-thread.js_LoadScript N/A 272.6 µs N/A

Comparing p/bench-transform (f03548e) with main (ac7d0eb)

Open in CodSpeed

Footnotes

  1. 26 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

upupming
upupming previously approved these changes Jun 3, 2026
@HuJean HuJean enabled auto-merge (squash) June 3, 2026 12:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

UI Judge

GEQI weighted score: 64.3 / 100 across 8 examples.
Average visual-correctness score: 3.3 / 5.

Dimension Weight Average Results Status
Usability & Interaction 30% 3.1 / 5 8 OK
Visual & Aesthetics 25% 3.3 / 5 8 OK
Consistency & Standards 15% 3.1 / 5 8 OK
Architecture & UX Writing 15% 3.3 / 5 8 OK
Accessibility & Performance 15% 3.4 / 5 8 OK
# Example Visual Correctness Usability & Interaction (30%) Visual & Aesthetics (25%) Consistency & Standards (15%) Architecture & UX Writing (15%) Accessibility & Performance (15%) GEQI Page Status
1 recs 2 / 5 2 / 5 3 / 5 2 / 5 2 / 5 3 / 5 48 / 100 preview OK
2 cast-grid 5 / 5 3 / 5 4 / 5 5 / 5 5 / 5 5 / 5 83 / 100 preview OK
3 citywalk-list 2 / 5 2 / 5 3 / 5 3 / 5 2 / 5 3 / 5 51 / 100 preview OK
4 fridge-search 3 / 5 3 / 5 3 / 5 3 / 5 3 / 5 3 / 5 60 / 100 preview OK
5 trip-planner 2 / 5 3 / 5 3 / 5 2 / 5 2 / 5 2 / 5 51 / 100 preview OK
6 weather-current 5 / 5 5 / 5 4 / 5 4 / 5 5 / 5 5 / 5 92 / 100 preview OK
7 product-card 5 / 5 5 / 5 4 / 5 4 / 5 5 / 5 4 / 5 89 / 100 preview OK
8 workout-plan 2 / 5 2 / 5 2 / 5 2 / 5 2 / 5 2 / 5 40 / 100 preview OK
Details

Result 1

  • Example: recs
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 2 / 5 (30%)
    • Visual & Aesthetics: 3 / 5 (25%)
    • Consistency & Standards: 2 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 3 / 5 (15%)
  • Task: The A2UI playground preview should show date-night dining recommendations for Moonlight Terrace, Pinewood Bistro, and Sea Breeze Kitchen.

Result 2

  • Example: cast-grid
  • Dimension: visual-correctness
  • Visual correctness: 5 / 5
  • GEQI dimensions:
    • Usability & Interaction: 3 / 5 (30%)
    • Visual & Aesthetics: 4 / 5 (25%)
    • Consistency & Standards: 5 / 5 (15%)
    • Architecture & UX Writing: 5 / 5 (15%)
    • Accessibility & Performance: 5 / 5 (15%)
  • Task: The A2UI playground preview should show a cast grid for the short film Night Notes, including Lin Xia and Zhou Ning cast cards.

Result 3

  • Example: citywalk-list
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 2 / 5 (30%)
    • Visual & Aesthetics: 3 / 5 (25%)
    • Consistency & Standards: 3 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 3 / 5 (15%)
  • Task: The A2UI playground preview should show weekend citywalk coffee picks with Rooftop Brew Room, Corner Canvas Lab, and Late Sun Roastery.

Result 4

  • Example: fridge-search
  • Dimension: visual-correctness
  • Visual correctness: 3 / 5
  • GEQI dimensions:
    • Usability & Interaction: 3 / 5 (30%)
    • Visual & Aesthetics: 3 / 5 (25%)
    • Consistency & Standards: 3 / 5 (15%)
    • Architecture & UX Writing: 3 / 5 (15%)
    • Accessibility & Performance: 3 / 5 (15%)
  • Task: The A2UI playground preview should show refrigerator search results with Siemens, Hualing, Haier, and Midea product cards.

Result 5

  • Example: trip-planner
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 3 / 5 (30%)
    • Visual & Aesthetics: 3 / 5 (25%)
    • Consistency & Standards: 2 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 2 / 5 (15%)
  • Task: The A2UI playground preview should show a Kyoto 48-hour trip planner with Day 1 and Day 2 itinerary sections, including Monkey Park Viewpoint.

Result 6

  • Example: weather-current
  • Dimension: visual-correctness
  • Visual correctness: 5 / 5
  • GEQI dimensions:
    • Usability & Interaction: 5 / 5 (30%)
    • Visual & Aesthetics: 4 / 5 (25%)
    • Consistency & Standards: 4 / 5 (15%)
    • Architecture & UX Writing: 5 / 5 (15%)
    • Accessibility & Performance: 5 / 5 (15%)
  • Task: The A2UI playground preview should show the current weather for Austin, TX, including clear skies with light breeze.

Result 7

  • Example: product-card
  • Dimension: visual-correctness
  • Visual correctness: 5 / 5
  • GEQI dimensions:
    • Usability & Interaction: 5 / 5 (30%)
    • Visual & Aesthetics: 4 / 5 (25%)
    • Consistency & Standards: 4 / 5 (15%)
    • Architecture & UX Writing: 5 / 5 (15%)
    • Accessibility & Performance: 4 / 5 (15%)
  • Task: The A2UI playground preview should show a Wireless Headphones Pro product card with a visible Add to Cart action.

Result 8

  • Example: workout-plan
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 2 / 5 (30%)
    • Visual & Aesthetics: 2 / 5 (25%)
    • Consistency & Standards: 2 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 2 / 5 (15%)
  • Task: The A2UI playground preview should show a weekly workout plan with five days from Monday Ramp-Up through Friday Conditioning.

Workflow run

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@website/sidebars/genui.ts`:
- Around line 150-153: Replace the English label in the sidebar entry that
currently has text: 'System Prompts' (the object whose link is
'/zh/guide/genui/a2ui/system-prompts') with a Chinese label such as '系统提示词' so
the ZH navigation is fully localized; update the text property of that sidebar
item accordingly.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 75cd6877-0f18-44db-9f1b-1f1247a35803

📥 Commits

Reviewing files that changed from the base of the PR and between 22b392b and 5e69a41.

📒 Files selected for processing (3)
  • packages/genui/a2ui/docs/system-prompts.md
  • packages/genui/a2ui/docs/system-prompts_zh.md
  • website/sidebars/genui.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/genui/a2ui/docs/system-prompts_zh.md

Comment thread website/sidebars/genui.ts
@HuJean HuJean merged commit a22943e into main Jun 3, 2026
44 checks passed
@HuJean HuJean deleted the p/bench-transform branch June 3, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants