logoalt Hacker News

pverheggenyesterday at 3:32 PM1 replyview on HN

The article acknowledges this in the very first paragraph:

> For most of us it’s things like reducing network requests, shrinking the bundle, or making good use of the cache.

These are likely going to be your first port of call for performance issues at your day job, but fixes like removing dependencies or making fewer network calls are pretty straightforward. I think the author chose to do a deep dive on the topic on freeing up the main thread because there's such a wide variety of approaches and many of them may not be obvious.


Replies

martinaldyesterday at 4:37 PM

I'm not sure the author realises _what_ a massive impact bundle size has on the main thread though, especially hydration. The majority of apps I've optimised over the years have the (often vast) majority of main thread time spent on the bundle parse/hydration (plus obviously network).

Also, removing dependencies is not easy. I've seen many corporate that have a huge UI lib for example that everyone should use for brand consistency. But it's many MBs of JS, because it has to cover every possible use case.

This doesn't even get into 3rd party vendors who _also_ ship react et al and have other bundles.

I'm not saying the article is wrong, but if you want to free main thread time especially at the most critical point (when the user has initially loaded the page) you _probably_ will find that most of the opp is in bundle size and hydration improvements.

show 2 replies