And by "people" I mean "developers" which makes it even more frightening.
Sadly, as a senior developer I've had to lay people off after I asked them, politely, numerous times to please stop trying to squeeze out the extra 15 milliseconds of some function that runs once a day and focus on the real problems on the list.
And not "Lumberg" politely ... just trying to explain that it is not a priority and we have bigger problems. It sucked. But soooo many people do this.
Because if you can shave it from 30 ms to 15 ms ... that's twice as fast. To the one person who might run it, once a day.
"But you have to pull in the whole library!".
Yes, well your logo in the top left corner is twice the size of jQuery and could be 100 times smaller and look the same.
Oh, and jQuery wasn't actually downloaded as you can see in the developer tools network panel ... it's cached on almost everyone's machine.
You can benchmark it yourself in the dev tools of whatever browser you want. This is not a hard number because it depends on the client browser, that browser's JS engine, and the client specs.
However, from the release notes, they are reducing this even further.
For the record, I think this is stupid too. Because now we're saving 7k for a version that might not be cached. Why not just stick with the regular 30k one which will likely transfer 0 bytes?
If you switch to the "Slim Build" then your server is going to be sending out 23.6k instead of 0k because it may not be cached.
Slim Build - Finally, we’ve added something new to this release.
Sometimes you don’t need ajax, or you prefer to use one of the many standalone libraries that focus on ajax requests.
And often it is simpler to use a combination of CSS and class manipulation for all your web animations.
Along with the regular version of jQuery that includes the ajax and effects modules, we’re releasing a “slim” version that excludes these modules.
All in all, it excludes ajax, effects, and currently deprecated code.
The size of jQuery is very rarely a load performance concern these days, but the slim build is about 6k gzipped bytes smaller than the regular version – 23.6k vs 30k.
Why not just stick with the regular 30k one which will likely transfer 0 bytes?
Did someone measured the actual cache hit rate when browsing many websites? Because if the deployed versions are too various or not using the same CDN, then the caching argument would be overestimated.
Because now we're saving 7k for a version that might not be cached.
Why would it be not cached compared to the previous releases?
Did someone measured the actual cache hit rate when browsing many websites? Because if the deployed versions are too various or not using the same CDN, then the caching argument would be overestimated.
The only answer to ALL of this is profiling. It's as simple as that.
What is using the most CPU cycles on page load on the client?
What is using the most CPU cycles on page load on the server?
What is using the most memory on page load on the client?
What is using the most memory on page load on the server?
What is using the most CPU cycles after having the page open for 2 hours?
What is using the most memory after having the page open for 2 hours?
What are the current Top 10 in terms of bytes across the wire?
etc, etc, etc.
If you can answer all those questions and any single of one them is answered by "jQuery" I'd be amazed. Unless it's a dynamic site that uses jQuery heavily, in which case it's perfectly fine (for CPU usage/client anyway). But that's not really jQuery that's more of the browser's rendering engine.
The whole reason I got in this thread it really bothers me when developers will instantly say things like "yeah but you have to realize you're bringing in a *32KB librarary!" without having any clue as to how that impacts overall site performance.
Which these days, if we're talking about jQuery, does not in the vast majority of situations.
It means people are not seeing the "big picture", or they "can't see the forest for the trees".
They get blinded into focusing on inconsequential stuff because in their head, they think it's a big deal. But it's not.
it really bothers me when developers will instantly say things like "yeah but you have to realize you're bringing in a *32KB librarary!" without having any clue as to how that impacts overall site performance.
It's the same thing about caching that's why I got also in this thread ^^
61
u/EternalNY1 Jun 10 '16 edited Jun 10 '16
Yes. I try to explain it, people don't get it.
And by "people" I mean "developers" which makes it even more frightening.
Sadly, as a senior developer I've had to lay people off after I asked them, politely, numerous times to please stop trying to squeeze out the extra 15 milliseconds of some function that runs once a day and focus on the real problems on the list.
And not "Lumberg" politely ... just trying to explain that it is not a priority and we have bigger problems. It sucked. But soooo many people do this.
Because if you can shave it from 30 ms to 15 ms ... that's twice as fast. To the one person who might run it, once a day.
"But you have to pull in the whole library!".
Yes, well your logo in the top left corner is twice the size of jQuery and could be 100 times smaller and look the same.
Oh, and jQuery wasn't actually downloaded as you can see in the developer tools network panel ... it's cached on almost everyone's machine.