Uppsats

The React Compiler in Practice: Assessing Rendering Efficiency and Memory Consumption

Kandidat-uppsats

Umeå universitet/Institutionen för datavetenskap

Publicerad: 2025

Språk: Engelska

Nyckelord

klicka för att söka

Sammanfattning

The rapid growth of React-based web applications has renewed attention on rendering efficiency, yet manual optimization with React.memo, useMemo, and useCallback remains error-prone and hard to scale. React 19 introduces the experimental React Compiler ("React Forget"), which promises to inject memoization automatically at build time. This thesis offers an early, independent, and end-to-end evaluation of that compiler. A purpose-built chat benchmark-implemented in TypeScript and bundled with Vite-simulates realistic high-frequency user-interface updates. Two functionally identical variants are tested: a prop-drilling tree that pushes every message through nested wrappers and a flat tree that renders messages directly. Each variant is compiled with and without the React Compiler. Automated Playwright scripts record component-level render counts via \textless Profiler/\textgreater, while Chrome DevTools snapshots capture heap usage. Workloads range from 100 to 10000 messages, with controlled batch sizes and artificial per-message delays. The results show that the compiler cuts unnecessary re-renders by up to 2500\% in deeply nested components. Performance gains scale with workload: larger batches and heavier component graphs amplify the benefit. The trade-off is a consistent memory overhead of roughly 8–15\% (135 MB at 10000 messages), attributable to compiler-inserted caches. No statistically significant differences are observed between prop drilling and flat tree topologies in either performance or memory. The study concludes that the React Compiler delivers substantial automatic rendering time savings with modest memory cost, provided that the components obey the purity rules of React. It therefore represents a practical pathway toward declarative, zero-maintenance performance tuning for most modern web applications, while memory-constrained deployments and projects using unconventional patterns should evaluate adoption case-by-case.

Information

Författare
Eriksson, James
Lärosäte / institution
Umeå universitet/Institutionen för datavetenskap
Publiceringsdatum
2025
Uppsatstyp
Kandidat-uppsats
Språk
Engelska

Utforska vidare

Liknande uppsatser

Uppsatser med liknande ämnen och nyckelord.