𝟩 𝗛𝗶𝗱𝗱𝗲𝗻 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗕𝗼𝘁𝘁𝗹𝗲𝗻𝗲𝗰𝗸𝘀 𝗔𝗻𝗱 𝗛𝗼𝘄 𝗧𝗼 𝗙𝗶𝘅 𝗧𝗵𝗲𝗺

Slow web apps rarely fail because of bad algorithms. They fail because of how your code talks to the browser.

I profiled 300 production applications. 73% of performance issues come from these 7 sources.

  1. Layout thrashing This happens when you read a property, write to the DOM, and read again. This forces the browser to recalculate layout repeatedly.
  1. Unbounded event listeners Adding an event listener without removing it creates memory leaks. This is a major issue in single-page apps.
  1. Synchronous DOM reads in loops Reading offsetWidth or getBoundingClientRect inside a loop triggers constant reflows.
  1. Missing requestAnimationFrame batching Direct DOM changes on scroll or resize events fire too often. This causes jank.
  1. Large JSON.parse payloads Parsing large files blocks the main thread. This causes input lag.
  1. Complex CSS selector matching Deeply nested or complex selectors slow down style recalculations.
  1. Duplicate bundle chunks Large, unoptimized bundles waste transfer time.

How to measure your progress:

Fixing these areas improves your Core Web Vitals, specifically Largest Contentful Paint and Interaction to Next Paint.

Source: https://dev.to/kui_luo/how-to-find-and-fix-7-hidden-performance-bottlenecks-in-your-javascript-code-ek5