Skip to content

perf(render): Memoize PinnedRepos and TopRepos Components to Prevent Redundant Re-Renders #1458

Description

@omkhandare55

Description

In our developer dashboard, whenever a global statistics sync triggers (via SSE in DashboardSSEProvider), both the PinnedRepos.tsx and TopRepos.tsx components completely re-render all repo cards, even when the contribution counts or items remain unchanged. This results in heavy UI thread thrashing on active profiles. We need to memoize these cards.

Requirements

  1. Component Memoization: Wrap PinnedRepos and TopRepos individual cards with React.memo using a strict key equality comparator.
  2. Computation Caching: Cache heavy sorting algorithms for top/pinned lists using the useMemo hook.

Files to Modify

  • src/components/PinnedRepos.tsx
  • src/components/TopRepos.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersgssoc26GSSoC 2026 contributionlevel:beginnerGSSoC: Beginner difficulty (20 pts)type:performanceGSSoC type bonus: performance (+15 pts)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions