Skip to content

perf: wrap ComboCard, HeroSection in React.memo - #7070

Merged
diegosouzapw merged 3 commits into
cheaper-inference:release/v3.8.49from
oyi77:perf/p1-memo
Jul 18, 2026
Merged

diegosouzapw merged 3 commits into
cheaper-inference:release/v3.8.49from
oyi77:perf/p1-memo

Conversation

@oyi77

@oyi77 oyi77 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Wrap two render-intensive components in React.memo to reduce unnecessary re-renders: ComboCard (Combos page) and HeroSection (EvalsTab).

Changes

 src/app/(dashboard)/dashboard/combos/page.tsx               | 5 +++--
 src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx  | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

Verification

  • ✅ tsc --noEmit — no new errors at changed lines
  • ✅ Pre-existing test failures only

@oyi77
oyi77 requested a review from diegosouzapw as a code owner July 13, 2026 19:33

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request upgrades the project to v3.8.47, expanding the provider catalog to 248 entries and adding an 18th routing strategy. Key technical changes include a new container runtime abstraction for skill sandboxing, improved CLI readiness diagnostics, and a transition to a changelog fragment system. The update also addresses credential resolution issues in the OpenCode plugin, adds support for the zh-TW locale, and includes various performance and resilience enhancements. The review comments identified a duplicate environment variable definition in .env.example and an inconsistency in artifact directory naming in .gitignore, both of which are actionable improvement opportunities.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread .env.example
Comment on lines +1851 to +1858
# Container runtime used by the skill sandbox. Accepted values:
# auto — pick the best installed runtime per host OS (default)
# docker — Docker Engine / Docker Desktop
# apple — Apple Container (macOS native, micro-VM)
# wsl — WSL Container (Windows native via wslc.exe)
# orbstack — OrbStack (high-perf Linux VM + docker shim on macOS)
# podman — Podman (rootless, daemonless)
# SKILLS_SANDBOX_RUNTIME=auto

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.

medium

The SKILLS_SANDBOX_RUNTIME variable is defined twice in this file. It was previously defined around line 225. This duplication can be confusing for developers setting up their environment.

To improve clarity and maintainability, please remove this second definition.

Comment thread .gitignore


# CI/local quality artifacts (eslint-results.json, etc.)
.artifacts/

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.

medium

This adds .artifacts/ to the ignore list, but _artifacts/ already exists on line 235. Having two similarly named directories for artifacts (.artifacts/ and _artifacts/) is confusing and suggests an inconsistency. Please consolidate these into a single, consistently named directory to improve project clarity.

@oyi77

oyi77 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @gemini-code-assist. The review seems to cover broader development changes (v3.8.47 cycle) that are present in this branch from upstream merges.

Our actual changes in this PR are limited to 2 files:

  • src/app/(dashboard)/dashboard/combos/page.tsx — wrap ComboCard in React.memo
  • src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx — wrap HeroSection in React.memo

The .env.example duplicate and .gitignore naming topics referenced are outside our change scope — those come from the development baseline this branch was built on.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Thanks for the clarification, @oyi77. That makes perfect sense—it's common for upstream merges to bring in baseline updates like .env.example and .gitignore changes that aren't part of the core PR intent. I've noted that your changes are strictly focused on the React.memo optimizations in src/app/(dashboard)/dashboard/combos/page.tsx and src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx.

@oyi77

oyi77 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Branch rebased on main (clean) and force-pushed. Ready for merge.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks for this — wrapping ComboCard/HeroSection in React.memo is a reasonable direction, but as written it's likely a no-op for ComboCard: the parent still passes ~7 inline arrow-function props (onEdit, onDelete, onDuplicate, onTest, onProxy, onToggle, onDragStart) that are recreated on every render, so memo's default shallow prop comparison will bail out ("props changed") on every single parent render regardless of the wrap. Could you also wrap those handlers in useCallback at the callsite (or pass stable dispatchers) so the memo actually gets to skip a render? Separately, could you drop PERFORMANCE_AUDIT_v3.8.48.md from the repo root, or move it under docs/ — it's unrelated to the two-component change and will collide with the same file in your other PRs.

@diegosouzapw
diegosouzapw changed the base branch from main to release/v3.8.49 July 15, 2026 08:18
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Babysit summary (automated CI-green check)

No code changes were needed this pass — CI was already fully green at HEAD (42dd863) by the time this check ran; the two previously-reported reds (PR Test Policy, Unit Tests 7/8) were already resolved by the author's own last two commits (adding tests/unit/ui/combos-page-smoke.test.tsx + tests/unit/ui/evals-tab-smoke.test.tsx, fixing the fork-CI check-test-masking-selfref-6634 base-ref lookup, and bumping the file-size-baseline.json entry for combos/page.tsx by +1 line with a justification comment, matching the real +1-line growth from wrapping ComboCard in React.memo).

Verified all 16 required checks pass (gh pr checks 7070 exit 0): Fast Quality Gates, No new ESLint warnings, Unit Tests fast-path 1-4/4, Vitest (fast-path), Docs Gates (fast-path), Change Classification, Merge integrity, semgrep, semgrep-cloud-platform/scan, dast-smoke.

Reviewed the production diff (ComboCard/HeroSection → React.memo) — minimal, correct wrapping, no behavior change. The file-size-baseline.json bump is legitimate (not the corrupted/rebaselined pattern seen on a sibling PR) — it's a targeted +1 entry with an inline justification comment tied to the real line-count delta, not a blanket rebaseline.

Not resolved (left for owner judgment): 2 unresolved gemini-code-assist review threads on .env.example (duplicate SKILLS_SANDBOX_RUNTIME) and .gitignore (.artifacts/ vs _artifacts/ naming). Neither file is part of the current diff vs release/v3.8.49 — they appear to be stale feedback from an earlier version of this branch. Leaving them unresolved since I didn't touch those files; owner/author should confirm and manually resolve if moot.

Ready for human review & merge — this run did not merge anything.

oyi77 added 3 commits July 17, 2026 05:07
…; fix selfref test in fork CI

- Add smoke tests for combos page and EvalsTab to satisfy PR Test Policy
  requiring tests for production code changes
- Fix selfref test (check-test-masking-selfref-6634) to try upstream/main
  first, falling back to origin/main, since origin/main may not exist in
  fork CI environments
… 4655->4656 after React.memo wrapping

The file-size checker's split('\n').length convention now counts 4656
for src/app/(dashboard)/dashboard/combos/page.tsx after wrapping
ComboCard in React.memo (+1 effective line).
@oyi77

oyi77 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto upstream/release/v3.8.49. Conflict resolved: kept upstream's hermetic disk-read version of check-test-masking-selfref-6634.test.ts. Non-essential PERFORMANCE_AUDIT_v3.8.48.md removed.

@diegosouzapw
diegosouzapw merged commit f287f42 into cheaper-inference:release/v3.8.49 Jul 18, 2026
15 checks passed
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks @oyi77! Merged into release/v3.8.49 after batch validation in the local merge-train (combined-tree static gates + tests + vitest all green). Where the file-size ratchet complained we compacted/extracted inside your branch keeping you as author.

@oyi77
oyi77 deleted the perf/p1-memo branch July 20, 2026 15:24
@diegosouzapw diegosouzapw mentioned this pull request Jul 23, 2026
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
* perf: wrap ComboCard, HeroSection in React.memo

* fix(cheaper-inference#7070): add test coverage for React.memo changes; fix selfref test in fork CI

- Add smoke tests for combos page and EvalsTab to satisfy PR Test Policy
  requiring tests for production code changes
- Fix selfref test (check-test-masking-selfref-6634) to try upstream/main
  first, falling back to origin/main, since origin/main may not exist in
  fork CI environments

* fix(cheaper-inference#7070): bump frozen baseline for combos/page.tsx 4655->4656 after React.memo wrapping

The file-size checker's split('\n').length convention now counts 4656
for src/app/(dashboard)/dashboard/combos/page.tsx after wrapping
ComboCard in React.memo (+1 effective line).

---------

Co-authored-by: oyi77 <oyi77@users.noreply.github.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
* perf: wrap ComboCard, HeroSection in React.memo

* fix(cheaper-inference#7070): add test coverage for React.memo changes; fix selfref test in fork CI

- Add smoke tests for combos page and EvalsTab to satisfy PR Test Policy
  requiring tests for production code changes
- Fix selfref test (check-test-masking-selfref-6634) to try upstream/main
  first, falling back to origin/main, since origin/main may not exist in
  fork CI environments

* fix(cheaper-inference#7070): bump frozen baseline for combos/page.tsx 4655->4656 after React.memo wrapping

The file-size checker's split('\n').length convention now counts 4656
for src/app/(dashboard)/dashboard/combos/page.tsx after wrapping
ComboCard in React.memo (+1 effective line).

---------

Co-authored-by: oyi77 <oyi77@users.noreply.github.com>
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.

2 participants