I'm not sure what using wget is supposed to show.
Using it 25 times in a row on a completely stable, completely idle 25mbps connection, I get speeds/times that vary by 100% consistently
(IE min is 496k/s, max is 895k/s, average is about 600k/s)
Using wget is a completely useless benchmark, from what I can tell.
Using apache's little benchmark tool I get about 255ms vs 180ms average for 100 requests to each.
The interesting part is that for ajax.googleapis.com I get:
Connection Times (ms)
min mean[+/-sd] median max
Connect: 175 228 28.2 227 306
Processing: 0 12 15.1 8 90
Waiting: 0 0 0.0 0 0
Total: 189 240 29.8 235 350
and for cloudflare I get:
Connection Times (ms)
min mean[+/-sd] median max
Connect: 19 28 13.1 25 125
Processing: 125 155 28.0 146 246
Waiting: 21 28 6.5 27 65
Total: 144 182 30.7 175 271
IE for google, all the time is in actually getting a connection and getting the bits, whereas, for cloudflare, there is actually some time waiting for their servers.
Using 5 concurrent requests actually gives me a massive advantage for google (cloudflare takes roughly the same time, google goes 4 times faster)
Interesting results, but let's think about a few things before we all switch to Cloudflare CDNJS.
1) Time to first byte. In my experience the biggest lag is the connection, not actually downloading the file (for small js, images, etc...) I don't know how to test this.
2) Caching, by using google for common libraries like jQuery your chance of the end client already having a local cached copy are much greater.
3) Reliability. I know google has been recently killing off it's products, and even I tweeted how they could break the internet by shutting off their hosted library API, but it's probably not going to happen. Can you say the same about cloudflare?
I'm not saying I like one more than the other, but these are some things I would like to address before switching my and my clients sites over.
I can't take a test run with wget seriously when there are better tools so easily available. It's beyond lazy.. it's incompetence, or worse, dishonest. He couldn't even be bothered to run it more than once from his own computer(!)
Doesn't this have network effects? The CDN used by the most sites becomes the most valuable since a user visiting your site will have the library cached.
I've always felt the benefit was that loading assets could be a networking no-op.
It probably varies enormously depending on your location.
Here in Vancouver, I get 1.25MB/s for Google's CDN and 1.15MB/s for CloudFare. Unless we have a distributed tool to test that on a massive scale, it will only reflect the greatly-varying differences between people's connections, "distance to CDN", DNS metrics and whatnot which I guess greatly impact the speeds observed.
Nevertheless I really like that this actually "exercises" the different services and provides some form of measuring and poking that improves the overall transparency and accountability.
Another point to make is server response time. I'm not making a claim one is better overall than the other, but at my location (boston) cloudflare's servers respond a bit faster. Just grabbing a couple different files between the two shows up to 300ms difference, but usually <100ms.
[edit] oh yeah, and this is all moot if your user already has it in cache, which is currently more likely from google.
Disclaimer: I'm not offering a perfect solution to the ideal test.
1.) Depends on how everyone is routing. The people replying directly to the OP's page are checking from different servers with god-knows-what kind of routing tables that the average web browser on the net does not have access to.
1b.) A better test would be to have people from different ISP's and different geographic locations testing this out. Routing is everything. In other words, let's see what results are seen by mom-and-pop from India, UK, Texas, Rhode Island, Montana, Nunavut, Brazil, China, and Nigeria.
2.) Already said, but worth pounding into the OP's head, Google is the most widely used for jQuery because everyone else is using it and harddrive cache is 1.21 jiggawatts faster than any networked CDN.
3.) Latency and overall speed need to be measured. What use is 88Mbps if you've got horrible latency? Sure, there are times when a courier on a bike is faster than FTP, but for small files that latency is a bigger deal.
I ran the test, did it five times for Google, five times for Cloudflare and for each and every single one Google won out (for the current location I am at ... work), the script I used is here:
This way it will also output how long it spent in each step, including connect, appconnect (if you try the SSL version), how long it spends in pretransfer and how long it takes to start the transfer at all. Followed by the size of the download and the header size.
This way you can get a much better idea as to why it is taking longer for one service over the other. The files themselves are relatively small so are not an accurate indicator of transfer speed.
Don’t forget that one of the advantages of CDNs is that the user may already have the file cached in their browser. This is why I use Google’s CDN for jQuery and CDNJS for everything else – more web sites use Google’s CDN for jQuery, so the user is more likely to have that cached. Not to mention the HTTP limitation of 3 simultaneous requests from one domain…
network effect of caching aside, I decided to run tests from 95 nodes around the world. Most of these have above average connectivity, however some are true "last-mile" nodes. The following data set consists of just over 2000 runs over one hour of testing.
(IE min is 496k/s, max is 895k/s, average is about 600k/s)
Using wget is a completely useless benchmark, from what I can tell. Using apache's little benchmark tool I get about 255ms vs 180ms average for 100 requests to each.
The interesting part is that for ajax.googleapis.com I get:
and for cloudflare I get: IE for google, all the time is in actually getting a connection and getting the bits, whereas, for cloudflare, there is actually some time waiting for their servers.Using 5 concurrent requests actually gives me a massive advantage for google (cloudflare takes roughly the same time, google goes 4 times faster)