perf(react-runtime): trim snapshot and commit hot paths#2353
perf(react-runtime): trim snapshot and commit hot paths#2353Yradex merged 2 commits intolynx-family:mainfrom
Conversation
- remove the redundant childNodes break guard in BackgroundSnapshotInstance - simplify commit patch guards now that snapshotPatch is always defined after the early return Validation: git diff --check
📝 WalkthroughWalkthroughTwo files in the snapshot and lifecycle modules are refined. The patch commit logic removes redundant null-chaining guards leveraging existing control flow. The background snapshot child node traversal is modified to eliminate early loop termination, iterating solely via sibling linkage. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will degrade performance by 21.09%
Performance Changes
Comparing Footnotes
|
Web Explorer#8506 Bundle Size — 728.6KiB (0%).28a3855(current) vs 7b7a0c6 main#8505(baseline) Bundle metrics
Bundle size by type
|
| Current #8506 |
Baseline #8505 |
|
|---|---|---|
384.4KiB |
384.4KiB |
|
342.04KiB |
342.04KiB |
|
2.16KiB |
2.16KiB |
Bundle analysis report Branch colinaaa:codex/runtime-micro-tri... Project dashboard
Generated by RelativeCI Documentation Report issue
|
React Example#6928 Bundle Size — 237.85KiB (-0.02%).28a3855(current) vs 7b7a0c6 main#6927(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch colinaaa:codex/runtime-micro-tri... Project dashboard Generated by RelativeCI Documentation Report issue |
React MTF Example#62 Bundle Size — 207.43KiB (-0.02%).28a3855(current) vs 7b7a0c6 main#61(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch colinaaa:codex/runtime-micro-tri... Project dashboard Generated by RelativeCI Documentation Report issue |
Yradex
left a comment
There was a problem hiding this comment.
看过了。这个 PR 基本是删冗余 guard:childNodes() 直接靠 linked-list 终止条件退出,commit.ts 里 snapshotPatch 在前置 return 之后也确实恒存在,改动和声明一致。CI 也全绿。
This extracts the misc micro-trims from
bundle-sizeinto a standalone slice.BackgroundSnapshotInstance.childNodes()by iterating directly untilnullsnapshotPatchis guaranteed after the early returnValidation:
git diff --checkpnpm exec biome checkcould not run in this worktree becausebiomeis not installed locally.issue: #17
Summary by CodeRabbit