menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

We Cut Blo...
source image

Dev

1M

read

4

img
dot

Image Credit: Dev

We Cut Blocking Time by 92% – A Story Starring useTransition

  • The article shares a story of resolving a major performance issue in a project leading to a 92% reduction in blocking time and a 60% decrease in API calls.
  • Challenges included sluggish UI, slow renders, and excessive API calls in a complex tree-table structure.
  • The solution involved breaking heavy dependencies, stopping recursive fetching, and decoupling renders to optimize performance.
  • Issues like excessive API requests, slow re-rendering, and state loss during global search were addressed and optimized.
  • By redesigning the data fetching approach to consolidate requests, the performance significantly improved with reduced network overhead.
  • To address laggy UI on URL changes, the dependency on URL changes was removed, transitioning to useTransition for non-blocking updates.
  • The architectural shift emphasized isolating states, batch requests, and breaking heavy renders for improved performance.
  • Lessons learned included the importance of architectural shifts for significant performance enhancements.
  • This optimization story highlights that looking from a higher architectural viewpoint can lead to substantial improvements beyond mere micro-optimizations.
  • The use of useTransition and isolated state changes led to substantial performance gains with small rerenders in less than 50ms.

Read Full Article

like

Like

For uninterrupted reading, download the app