performance-optimization

Profile React apps with DevTools Profiler and apply memoization and code splitting.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Whaleylaw/llm-lawyer --skill performance-optimization-whaleylaw
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/Whaleylaw/llm-lawyer/tree/main/.claude/skills/performance-optimization
Command: npx skills add https://github.com/Whaleylaw/llm-lawyer --skill performance-optimization-whaleylaw

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identifies and fixes performance bottlenecks in React applications to reduce slow renders, excessive re-renders, large bundle sizes, memory leaks, and poor Lighthouse scores so users experience faster, more responsive interfaces.

Core Features & Use Cases

  • Profiling & Diagnosis: Use browser Performance tools, Lighthouse, and React DevTools Profiler to locate slow components and heavy bundles.
  • Render Optimization: Apply React.memo, useMemo, and useCallback patterns to prevent unnecessary re-renders and expensive recalculations.
  • Code Splitting & Lazy Loading: Use route-based splitting, React.lazy, and Suspense to reduce initial load time and defer heavy dependencies.
  • Asset & Network Optimization: Optimize images, use responsive formats, compress assets, and monitor network requests.
  • List Virtualization & Event Throttling: Virtualize long lists with react-window or react-virtual, and debounce/throttle user inputs and scroll handlers.
  • Memory & Cleanup: Cancel fetches, clear timers, and remove listeners to prevent leaks.
  • Verification: Re-run profiling and Lighthouse audits and measure Core Web Vitals to confirm improvements.

Quick Start

Profile the app with React DevTools Profiler, identify the largest rendering hotspots, and apply memoization or route-based code splitting to reduce render time and bundle size.

Frequently Asked Questions about performance-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce unnecessary component re-renders in React?▼

Reduce unnecessary React component re-renders by applying React.memo, useMemo, and useCallback patterns. Profile component trees with React DevTools Profiler to identify rendering hotspots before applying memoization techniques to prevent expensive recalculations.

What is the best way to optimize React bundle size and initial load time?▼

Optimize React bundle size and initial load time by applying route-based code splitting, React.lazy, and Suspense. This defers heavy dependencies and reduces the initial payload delivered to the browser during the first render.

How do I measure Core Web Vitals like LCP and CLS for a React app?▼

Measure React Core Web Vitals like LCP, FID, and CLS using browser performance tools and Lighthouse. Run profiling and audits before and after code changes to verify that optimization techniques actually improve user experience metrics.

How do I virtualize long lists in React to improve scroll performance?▼

Virtualize long lists in React using react-window or react-virtual to improve scroll performance. This technique renders only the visible items in the DOM, preventing memory leaks and reducing the rendering load for large datasets.

When should I debounce or throttle user inputs and scroll handlers in React?▼

Debounce or throttle user inputs and scroll handlers in React when dealing with rapid events to prevent performance bottlenecks. This event throttling technique limits the frequency of state updates and expensive recalculations during continuous interaction.

How do I prevent memory leaks when canceling fetches and clearing timers in React?▼

Prevent memory leaks by canceling active fetches, clearing timers, and removing event listeners during React component cleanup. This ensures that deferred dependencies and background processes do not retain memory after unmounting.