> Page is slow because the average page size is 2.2mb. Plus JavaScript parsing + execution time. Plus asynchronous calls to go load more stuff. Plus time to re-layout around the new stuff.
I think it's mostly blocking chains of multiple networks requests that execute in sequence (taking a network round-trip each time). I inherited a slow ~2mb frontend app at work, which seemed horrendously bloated to me. It turned out to be not that easy to reduce to the size (due to large amounts of code depending on large libraries), but it also turned out to be possible to make it load fast without reducing the payload size.
There was no tracking or ad code except error reporting to bugsnag. Most of it was the firebase SDK. Which we did work towards removing, but which was a long term project because:
- Every single database read depended on it
- Many of them were subscriptions rather than simple reads, and so couldn’t be trivially replaced by an API call.
That's a lot better than it used to be. IIRC, at the time I was working on the mentioned app the Firestore SDK was 700kb minimum just by itself, and with Auth and Firebase Realtime Database as well I believe we were over a megabyte just for firebase! For comparison, our API abstraction layer for functionality not using Firebase was under a kilobyte.
I think it's mostly blocking chains of multiple networks requests that execute in sequence (taking a network round-trip each time). I inherited a slow ~2mb frontend app at work, which seemed horrendously bloated to me. It turned out to be not that easy to reduce to the size (due to large amounts of code depending on large libraries), but it also turned out to be possible to make it load fast without reducing the payload size.