Achieving a 100/100 Lighthouse score on a complex React application requires more than just running a build. It demands a rigorous understanding of the Virtual DOM, execution pipelines, and cumulative layout metrics. This guide details the practical steps I took to optimize this portfolio.
Identifying Render Bottlenecks
Every state change in React triggers a reconciliation cycle. While the Virtual DOM is fast, unnecessary re-renders of heavy components compound CPU work. To trace this, open React DevTools Profiler in your browser and record a standard user interaction session.In React, the reconciliation process compares the newly returned element tree with the previous one. If there are changes, React updates the actual DOM. However, even if the DOM is not touched, computing the Virtual DOM differences still consumes main-thread execution time.