Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



Unless your website is some kind of game or application why the hell does it have 2 megs of JS? Remove your shitty tracking and ad code.


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.

Don’t use firebase guys.


<I work for Firebase>

You can see the size of each bundle in here: https://firebase.google.com/docs/web/sdk-metrics


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: