3 ms·
I'm a front-end developer and when I run into software that is slow, I assume it is because it includes a 10-pound bag of libraries while only using a minute pe
by protonfish 12y ago
I'm a front-end developer and when I run into software that is slow, I assume it is because it includes a 10-pound bag of libraries while only using a minute percentage of their functionality. (And that functionality could be implemented with 10 lines of vanilla JavaScript.)
- probablybroken 12y agoIn general code that doesn't get used doesn't increase your run time ( though in the case of JS you will obviously have to download it once, and parse the file on load ).
- TheLoneWolfling 12y agoNo, but code that does get called in case you've done something weird even though you haven't does. And that's a large chunk of many libraries.
- phkahler 12y ago>> I assume it is because it includes a 10-pound bag of libraries... Yes. The biggest source of this problem is that someone calling a function doesn't know how that function actually works and what its time complexity is. Sometimes it's that a function is asymptotically slower than it needs to be, but often it's that writing a composite of the calling and called functions could result in combining an inner and outer loop. When you use large libraries that do more complex things, your opportunity to optimize across levels goes away because you can't know all the code and where this issue will come up.