r/programming • • Jun 09 '16

jQuery 3.0 Released!

https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/
1.1k Upvotes

354 comments sorted by

View all comments

Show parent comments

1

u/tuxayo Jun 11 '16

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?

1

u/EternalNY1 Jun 11 '16

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.

[MaxCDN says "We usually average around 15,000 hits per second to our CDN with 99.8% of those being cache hits."] (https://news.ycombinator.com/item?id=9866697)

Why would it be not cached compared to the previous releases?

It would be, but it's "yet another thing to cache", for 7k bytes?

CDN JS Usage Statistics

jQuery CDN Usage Statistics

1

u/tuxayo Jun 12 '16

MaxCDN says "We usually average around 15,000 hits per second to our CDN with 99.8% of those being cache hits."

I was referring to browser cache hits. The link particularly insists on the fact that those 99.8% are not browser cache hits.

Why would it be not cached compared to the previous releases?

It would be, but it's "yet another thing to cache", for 7k bytes?

Right, that would lower the hit rate.

2

u/EternalNY1 Jun 12 '16 edited Jun 12 '16

I get it.

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.

2

u/tuxayo Jun 13 '16

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

Thanks for all the advice :)