Skip to content

test: add static text case for bench#1906

Merged
HuJean merged 1 commit intomainfrom
p/HuJean/text-bench
Oct 30, 2025
Merged

test: add static text case for bench#1906
HuJean merged 1 commit intomainfrom
p/HuJean/text-bench

Conversation

@HuJean
Copy link
Copy Markdown
Collaborator

@HuJean HuJean commented Oct 29, 2025

Summary by CodeRabbit

  • New Features

    • Added a new static text rendering benchmark test case to measure performance
    • New npm scripts available for running benchmarks and generating performance profiles
  • Chores

    • Updated test coverage configuration for improved snapshot directory handling

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).

@HuJean HuJean requested a review from hzy as a code owner October 29, 2025 15:06
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Oct 29, 2025

⚠️ No Changeset found

Latest commit: 7df2767

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 29, 2025

📝 Walkthrough

Walkthrough

This PR introduces a new React benchmark case (006-static-raw-text) that renders 100 identical static text nodes using runAfterLoadScript and root.render. The change includes a new TSX benchmark file, corresponding build configuration entry, and npm scripts for benchmarking and performance profiling.

Changes

Cohort / File(s) Summary
New benchmark case
benchmark/react/cases/006-static-raw-text/index.tsx
Adds new TSX file rendering 100 text nodes ("Hello, ReactLynx 🎉!") within runAfterLoadScript wrapper followed by RunBenchmarkUntilHydrate component.
Build configuration
benchmark/react/lynx.config.js
Adds "006-static-raw-text" entry to source.entry configuration, including patchProfile.ts and the new benchmark case file.
Benchmark scripts
benchmark/react/package.json
Adds bench:006-static-raw-text and perfetto:006-static-raw-text scripts for running the benchmark and performance profiling with --wait-for-id=stop-benchmark-true flag.
Test coverage configuration
vitest.config.ts
Replaces targeted template-*/** exclusion with broader /tests/swc_snapshots/ pattern in coverage exclude list.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • benchmark/react/cases/006-static-raw-text/index.tsx: Straightforward benchmark implementation with repetitive text node creation; verify the runAfterLoadScript and root.render usage aligns with existing benchmarks (001-005).
  • benchmark/react/lynx.config.js: Verify new entry key follows naming conventions and patchProfile.ts inclusion is consistent with other entries.
  • vitest.config.ts: Confirm the broader snapshot exclusion pattern doesn't unintentionally suppress coverage for desired test snapshots.

Possibly related PRs

Suggested labels

framework:React

Suggested reviewers

  • hzy
  • colinaaa

Poem

🐰 Hop, hop! A sixth case hops in line,
One hundred texts in static design!
Lynx celebrates with emoji so bright,
Benchmarks and profiles—performance takes flight! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "test: add static text case for bench" accurately describes the primary change across the four modified files. The PR adds a new benchmark test case (006-static-raw-text) for rendering static text, which requires creating the TSX benchmark file, updating the build configuration in lynx.config.js, and adding corresponding npm scripts in package.json. The title is concise, clear, and specific enough that a teammate scanning the repository history would immediately understand this is about introducing a new static text benchmark. The vitest.config.ts change appears to be a minor supporting adjustment to the coverage exclusion pattern rather than the main focus. The title directly reflects the core objective without unnecessary vagueness or noise.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch p/HuJean/text-bench

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 Oct 29, 2025

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 Oct 29, 2025

CodSpeed Performance Report

Merging #1906 will degrade performances by 6%

Comparing p/HuJean/text-bench (7df2767) with main (96545dd)

Summary

❌ 1 regression
✅ 52 untouched
🆕 9 new
⏩ 3 skipped1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 006-static-raw-text-destroyBackground N/A 1.7 ms N/A
🆕 006-static-raw-text-hydrate N/A 1.6 ms N/A
🆕 006-static-raw-text-renderBackground N/A 2.8 ms N/A
🆕 006-static-raw-text/background.js_LoadScript N/A 475.7 µs N/A
🆕 006-static-raw-text/main-thread.js_LoadScript N/A 396.3 µs N/A
🆕 006-static-raw-text__main-thread-processData N/A 21.5 µs N/A
🆕 006-static-raw-text__main-thread-renderMainThread N/A 1.6 ms N/A
🆕 006-static-raw-text__main-thread-renderOpcodes N/A 4.3 ms N/A
🆕 006-static-raw-text__main-thread-serializeRoot N/A 918.3 µs N/A
basic-performance-scroll-view-100 8.9 ms 9.5 ms -6%

Footnotes

  1. 3 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.

@relativeci
Copy link
Copy Markdown

relativeci bot commented Oct 29, 2025

React Example

#6027 Bundle Size — 237.5KiB (0%).

7df2767(current) vs 96545dd main#6010(baseline)

Bundle metrics  no changes
                 Current
#6027
     Baseline
#6010
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 165 165
No change  Duplicate Modules 67 67
No change  Duplicate Code 46.77% 46.77%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#6027
     Baseline
#6010
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.74KiB 91.74KiB

Bundle analysis reportBranch p/HuJean/text-benchProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Oct 29, 2025

Web Explorer

#6023 Bundle Size — 364.68KiB (0%).

7df2767(current) vs 96545dd main#6006(baseline)

Bundle metrics  Change 1 change
                 Current
#6023
     Baseline
#6006
No change  Initial JS 144.63KiB 144.63KiB
No change  Initial CSS 32.11KiB 32.11KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 219(+0.46%) 218
No change  Duplicate Modules 16 16
No change  Duplicate Code 3.23% 3.23%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#6023
     Baseline
#6006
No change  JS 238.77KiB 238.77KiB
No change  Other 93.8KiB 93.8KiB
No change  CSS 32.11KiB 32.11KiB

Bundle analysis reportBranch p/HuJean/text-benchProject dashboard


Generated by RelativeCIDocumentationReport issue

@HuJean HuJean merged commit c1225ac into main Oct 30, 2025
84 of 87 checks passed
@HuJean HuJean deleted the p/HuJean/text-bench branch October 30, 2025 02:49
Copy link
Copy Markdown

@kimixuchen kimixuchen left a comment

Choose a reason for hiding this comment

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

👍

@coderabbitai coderabbitai bot mentioned this pull request Mar 27, 2026
3 tasks
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.

3 participants