P
💻DeveloppementIntermediateChatGPT

Optimize React Application Performance

Optimize your React application to achieve excellent Core Web Vitals metrics through advanced memoization and code splitting techniques.

Paste in your AI

Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.

Tu es un expert en performance frontend spécialisé dans React et l'optimisation des Core Web Vitals. Mon application React souffre de problèmes de performance que je dois résoudre.

**Métriques actuelles :**
- LCP (Largest Contentful Paint) : [EX: 4.2s, objectif < 2.5s]
- FID/INP (Interaction to Next Paint) : [EX: 320ms, objectif < 200ms]
- CLS (Cumulative Layout Shift) : [EX: 0.25, objectif < 0.1]
- Taille du bundle JS : [EX: 2.3MB non compressé]

**Stack technique :**
- React [VERSION] avec [EX: Next.js 14, Vite, Create React App]
- Gestion d'état : [EX: Redux Toolkit, Zustand, Context API]
- Composant ou page problématique : [DESCRIPTION]

**Code du composant problématique :**
```jsx
[COLLER_LE_COMPOSANT_REACT]
```

Analyse et optimise en couvrant :

1. **Re-renders inutiles** : identifie les causes et applique React.memo, useMemo, useCallback avec justification pour chaque usage.
2. **Code splitting** : identifie les opportunités de lazy loading avec React.lazy et Suspense.
3. **Optimisation des images** : formats modernes (WebP, AVIF), lazy loading natif, dimensions explicites.
4. **Virtualisation** : si des listes longues sont présentes, implémente react-virtual ou react-window.
5. **Bundle analysis** : identifie les dépendances lourdes et propose des alternatives légères.
6. **Métriques après optimisation** : estime l'amélioration attendue pour chaque métrique Core Web Vitals.

Why this prompt works

<p>This prompt integrates Core Web Vitals metrics as a starting point because they provide measurable objectives and correspond to Google's ranking criteria. This data-driven approach ensures optimizations are prioritized based on their actual impact on user experience.</p><p>Requesting justification for each use of React.memo, useMemo, and useCallback is crucial: these optimizations are often misapplied and can even degrade performance if used incorrectly. Contextual explanation prevents the frequent misuse by intermediate React developers.</p><p>Estimating expected gains for each optimization transforms the analysis into a prioritized action plan, allowing efforts to focus on high-impact changes before tackling micro-optimizations.</p>

Use Cases

Improving Core Web Vitals for SEOOptimizing slow React applicationsReducing JavaScript bundle size

Expected Output

A React performance issue analysis with optimized code, optimization explanations, and estimated Core Web Vitals gains.

Learn more

Check the full skill on Prompt Guide to master this technique from A to Z.

View on Prompt Guide

📬 Get new prompts every week

Join our newsletter and never miss a prompt.

Similar Prompts

💻DeveloppementIntermediateAll AIs

Optimize Your SQL Queries and Boost Performance

A complete prompt to analyze, diagnose, and optimize your SQL queries with indexing and rewriting recommendations adapted to your database engine.

064
💻DeveloppementBeginnerChatGPT

Install and Configure PostgreSQL for a Project

Install and configure PostgreSQL from scratch with database creation, users, application connection, and first SQL queries.

1481
💻DeveloppementIntermediateClaude

Implement Robust Error Handling in Node.js

Create a professional Node.js error handling architecture with custom error classes, centralized middleware, and monitoring.

3369
💻DeveloppementAdvancedClaude

Implement Clean Architecture in Practice

Implement Clean Architecture in practice with layers, ports and adapters, use cases, and unit tests without infrastructure.

4890