6 ms·
> The issue is how many computations you do at runtime. That is completely unrelated to third party libraries. Citation needed. Do you have some linkable metri
by jagged-chisel 6y ago
> The issue is how many computations you do at runtime. That is completely unrelated to third party libraries.
Citation needed. Do you have some linkable metrics on how all those JS libs are reorganized and optimized (similar to how a compiler might do it on native code) such that the call to overlay or animate on a web page doesn't call through a sizable portion of those libs on every call?
- charrondev 6y agoIn a “modern” JS project, the vast majority of dependencies are normally development dependencies. When you see so many generally 90% of it comes from dev/build time dependencies like webpack, typescript, linters, etc. If you write hello world in rust, you wouldn’t act as if the generated binary has all of the runtime dependencies of of the compiler, unit test framework, formatted, etc. So why does JavaScript get the same treatment?
- ogre_codes 6y ago> So why does JavaScript get the same treatment? Because very frequently sites with minimal functionality have large piles of javascript. Web sites which should take milliseconds to launch take seconds instead. Some of this is ad-tech, but a lot of sites are overloaded with junk before the ad-tech gets stacked on top of it. Look at moment.js, the most used date library on the web. It is exceptionally common for people to add a library like that to a site to add a few basic bits of date parsing. (And yes I know moment is being sunsetted). Even if you assume these big piles of code do nothing once they are loaded, passing around and parsing big chunks of Javascript every time you launch a web page is a waste. Though as someone else pointed out above, web pages are not a big contributor to Global warming. It's just a frustrating, time consuming waste in most cases.