Wiki: Winning the Performance Race

For agents: Markdown version · Wiki index · Explore

Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

Summary

The speaker shares strategies and lessons learned from improving the performance of millions of large-scale web applications. The main argument is that achieving high performance at scale requires systematically reducing client-side JavaScript bundle sizes and properly managing module loading and initialization. The audience learns how to split monolithic UI components, leverage server-side rendering for heavy calculations, and apply Inversion of Control patterns to handle complex dependencies.

Key points

  • 1:13 The speaker introduces Core Web Vitals as a standard metric used by Google and competitors to measure and improve user experience across platforms.
  • 3:42 JavaScript is highlighted as the heaviest resource in web applications, affecting both network and CPU performance.
  • 4:48 A detailed code example of a button component demonstrates how unused code and heavy logic frequently bloat client-side bundles.
  • 9:07 The first solution involves splitting monolithic components and moving heavy logic and props calculation to a server-side environment.
  • 13:21 Alternative methods such as React Server Components, Suspense, and specialized frameworks can also help minimize client-side JavaScript.
  • 17:42 The speaker transitions to discussing module loading strategies and initialization bottlenecks in complex enterprise applications.
  • 25:43 An Inversion of Control pattern combined with asynchronous module loaders is introduced to solve dependency management and parallel execution issues.

Takeaways

  • Move heavy data calculations and unused rendering logic from the client to a front-end server or BFF layer.
  • Split large UI components into smaller, dynamic modules to ensure users only download the code they actually need.
  • Use an Inversion of Control pattern to decouple module dependencies and enable efficient parallel initialization.

Questions this talk answers

  • How can I reduce my React application’s JavaScript bundle size when using complex UI components with many conditional variants?
  • What is the best way to handle asynchronous initialization and dependencies between multiple large frontend modules?
  • How do server-side rendering and Server Components impact client-side performance and hydration?

Technologies

JavaScript, Node.js, React, Next.js

Tags

architecture, bundle size, frontend performance, javascript optimization, react, server side rendering