Skip to content

ci(benchmark/react): ignore some benchmarks#1625

Merged
hzy merged 1 commit intolynx-family:mainfrom
hzy:p/hzy/bench_3
Aug 29, 2025
Merged

ci(benchmark/react): ignore some benchmarks#1625
hzy merged 1 commit intolynx-family:mainfrom
hzy:p/hzy/bench_3

Conversation

@hzy
Copy link
Copy Markdown
Collaborator

@hzy hzy commented Aug 29, 2025

Summary by CodeRabbit

  • New Features
    • Added a new zeroStats method to the benchmarking interface for resetting/ignoring metric accumulation.
  • Bug Fixes
    • Excluded internal profiling events from benchmarks to prevent skewed results and improve metric accuracy.
  • Refactor
    • Switched benchmark naming to repository-relative prefixes for clearer identification and grouping across environments.
  • Chores
    • Updated build to include a newer cherry-picked patch, ensuring the bundled binary reflects recent fixes.

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

Copilot AI review requested due to automatic review settings August 29, 2025 04:26
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 29, 2025

⚠️ No Changeset found

Latest commit: 5bc2409

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

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds a new Codspeed API method zeroStats in React benchmark typings; updates React profiling patch to ignore certain profile names and change benchmark name prefix derivation; updates benchx_cli build script to cherry-pick a different commit hash.

Changes

Cohort / File(s) Summary of Changes
React benchmark typings
benchmark/react/rspeedy-env.d.ts
Added Codspeed.zeroStats(): void to the declared Codspeed interface; other signatures unchanged.
React profiling instrumentation
benchmark/react/src/patchProfile.ts
Compute repository-based PREFIX from __REPO_FILEPATH__; add ignored map to mark commitChanges and ReactLynx::diff::* frames; push __IGNORED__ for ignored frames and call Codspeed.zeroStats() on profile end; use ${PREFIX}::${__webpack_chunkname__}-${name!} for recorded benchmarks.
Benchx CLI build script
packages/lynx/benchx_cli/scripts/build.mjs
Updated PICK_COMMIT from '471ebc337ca762e08de0d1e488e21ed79c8107c1' to '033e8243747fa0b3ffc01e4b2df321d73a30597f'; build logic unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • colinaaa
  • PupilTong

Poem

I thump my paw—zero the stats!
Ignore the noisy diffing chats.
Paths trimmed short, a prefix new,
A different hash to build anew.
Carrot tucked, benchmarks nap true. 🥕🐇


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4e8e3d6 and 5bc2409.

📒 Files selected for processing (3)
  • benchmark/react/rspeedy-env.d.ts (1 hunks)
  • benchmark/react/src/patchProfile.ts (1 hunks)
  • packages/lynx/benchx_cli/scripts/build.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • benchmark/react/rspeedy-env.d.ts
  • benchmark/react/src/patchProfile.ts
  • packages/lynx/benchx_cli/scripts/build.mjs
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the benchmark infrastructure to selectively ignore certain performance benchmarks from being recorded. The changes focus on filtering out specific benchmark profiles that may be noisy or less relevant for performance tracking.

  • Updates the commit hash reference in the build script for benchmark CLI
  • Implements benchmark filtering logic to ignore commitChanges and ReactLynx::diff::* benchmarks
  • Replaces webpack path reference with a custom prefix for cleaner benchmark naming

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/lynx/benchx_cli/scripts/build.mjs Updates PICK_COMMIT hash reference
benchmark/react/src/patchProfile.ts Adds benchmark filtering logic and path prefix cleanup

Comment thread benchmark/react/src/patchProfile.ts
Comment thread benchmark/react/src/patchProfile.ts
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 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!

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: 5

🧹 Nitpick comments (2)
benchmark/react/rspeedy-env.d.ts (1)

7-12: Consider augmenting existing types instead of re-declaring Codspeed

If @lynx-js/rspeedy/client already declares Codspeed, prefer declaration merging to avoid duplicate global symbol collisions.

Example:

declare global {
  const Codspeed: {
    startBenchmark(): void;
    stopBenchmark(): void;
    setExecutedBenchmark(name: string): void;
    zeroStats(): void;
  };
}
export {};
packages/lynx/benchx_cli/scripts/build.mjs (1)

95-103: Build robustness: handle cherry-pick conflicts explicitly

Cherry-picking an arbitrary PICK_COMMIT without commit or conflict handling can leave a dirty tree and still proceed to build. Consider failing fast on conflicts or committing the pick.

Option: add --allow-empty commit to materialize the pick and verify tree cleanliness.

 git fetch hzy ${PICK_COMMIT}
-git cherry-pick -n ${PICK_COMMIT}
+git cherry-pick -n ${PICK_COMMIT}
+git diff --quiet || (echo "Uncommitted changes after cherry-pick" && exit 1)
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 63beddd and 4e8e3d6.

📒 Files selected for processing (3)
  • benchmark/react/rspeedy-env.d.ts (1 hunks)
  • benchmark/react/src/patchProfile.ts (1 hunks)
  • packages/lynx/benchx_cli/scripts/build.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
benchmark/react/src/patchProfile.ts (1)
benchmark/react/src/hook.ts (1)
  • hook (5-16)
🔇 Additional comments (1)
benchmark/react/rspeedy-env.d.ts (1)

11-12: Confirm runtime implements Codspeed.zeroStats()
patchProfile.ts invokes this new API; ensure the runtime bundle exports zeroStats in all target environments to avoid runtime errors.

Comment thread benchmark/react/src/patchProfile.ts
Comment thread benchmark/react/src/patchProfile.ts
Comment thread benchmark/react/src/patchProfile.ts
Comment thread packages/lynx/benchx_cli/scripts/build.mjs
@hzy hzy requested review from PupilTong and upupming August 29, 2025 05:18
@relativeci
Copy link
Copy Markdown

relativeci bot commented Aug 29, 2025

React Example

#4713 Bundle Size — 237.06KiB (0%).

5bc2409(current) vs 63beddd main#4710(baseline)

Bundle metrics  no changes
                 Current
#4713
     Baseline
#4710
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 158 158
No change  Duplicate Modules 64 64
No change  Duplicate Code 45.83% 45.83%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#4713
     Baseline
#4710
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.3KiB 91.3KiB

Bundle analysis reportBranch hzy:p/hzy/bench_3Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Aug 29, 2025

Web Explorer

#4706 Bundle Size — 367.43KiB (0%).

5bc2409(current) vs 63beddd main#4703(baseline)

Bundle metrics  Change 2 changes
                 Current
#4706
     Baseline
#4703
No change  Initial JS 144.23KiB 144.23KiB
No change  Initial CSS 31.84KiB 31.84KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 220(+0.46%) 219
No change  Duplicate Modules 16 16
Change  Duplicate Code 3.32%(-0.3%) 3.33%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#4706
     Baseline
#4703
No change  JS 235.43KiB 235.43KiB
No change  Other 100.16KiB 100.16KiB
No change  CSS 31.84KiB 31.84KiB

Bundle analysis reportBranch hzy:p/hzy/bench_3Project dashboard


Generated by RelativeCIDocumentationReport issue

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Aug 29, 2025

CodSpeed Performance Report

Merging #1625 will not alter performance

Comparing hzy:p/hzy/bench_3 (5bc2409) with main (63beddd)

Summary

✅ 13 untouched benchmarks
🆕 6 new benchmarks
⁉️ 7 dropped benchmarks

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

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 002-hello-reactLynx-destroyBackground N/A < 1 ns N/A
🆕 002-hello-reactLynx-hydrate N/A 1.4 ms N/A
🆕 002-hello-reactLynx-setAttribute N/A 21.3 µs N/A
🆕 002-hello-reactLynx__main-thread-processData N/A 19 µs N/A
🆕 002-hello-reactLynx__main-thread-renderOpcodesInto N/A 1.6 ms N/A
🆕 002-hello-reactLynx__main-thread-renderToString N/A 1.6 ms N/A
⁉️ 002-hello-reactLynx-commitChanges 97.1 µs N/A N/A
⁉️ 002-hello-reactLynx-destroyBackground < 1 ns N/A N/A
⁉️ 002-hello-reactLynx-hydrate 1.4 ms N/A N/A
⁉️ 002-hello-reactLynx-setAttribute 21.5 µs N/A N/A
⁉️ 002-hello-reactLynx__main-thread-processData 18.9 µs N/A N/A
⁉️ 002-hello-reactLynx__main-thread-renderOpcodesInto 1.6 ms N/A N/A
⁉️ 002-hello-reactLynx__main-thread-renderToString 1.6 ms N/A N/A

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants