4 ms·
It's also possible to dynamically, lazily load some parts of the JS code. Surely not all the code is needed all the time. For example, you may not need to load
by tachyonbeam 9y ago
It's also possible to dynamically, lazily load some parts of the JS code. Surely not all the code is needed all the time. For example, you may not need to load the code for the settings page until the user actually goes to edit the settings.
- Yoric 9y agoStill, in my experience, Facebook chats loads several Megabytes (that's gzipped size) of JavaScript upon startup. In this case, lazy loading gets into the way of performance, as Facebook chat ends up lazily loading 102 files (if I recall correctly).
- djeric3 9y agoYes, Facebook already lazily loads code for secondary functionality. More details in this comment https://news.ycombinator.com/item?id=14912871 https://news.ycombinator.com/item?id=14912871
- codedokode 9y agoPlease also look at my comment that shows the opposite: Facebook is loading a lot of unnecessary modules: https://news.ycombinator.com/item?id=14916177 https://news.ycombinator.com/item?id=14916177
- djeric3 9y agoYup, replied above. Thanks for digging into this more :)