> How many times can we download google.com in a second?Exact answer: 4
I was a little suprised by this one. Sure, network connections are are going to be much slower than local operations, but where's the time going? Is it mostly the network latency? Google has a lean webpage, so I assume it has nothing to do with google specifically.
This also surprised me. A large part of it I'm sure has to do with the fact that I'd assume (given these numbers) urllib2 auto follows redirection. The request is to `http://` so it must make an additional request. Otherwise I'd expect them to be much higher as there would be no 'body' to the responses.
If your average connection has 100 ms (50 ms would be extremely good but doable these days) of round trip latency to Google.com, then you have a hard upper limit of 10 loads per second just to connect to the system. Then you have to move the data, store it in memory, parse it, and run it.
I'd be shocked if my latency to Google were even as high as 50 ms. Though downloading http will take 3 round trips for http and four round trips for https which will add up if the connection isn't kept alive after each download.
Edit: just tested and got these numbers for myself:
You're absolutely right and speeds to Google have gotten much faster over time. For what it's worth, I just ran a quick ping test and got 26ms average latency to google.com so I should have checked before I posted. Thanks for keeping me in check.
Still this is dependent on where you are, your ISP, other general factors, and it's still within an order of magnitude which was the point of the "quiz"
I was a little suprised by this one. Sure, network connections are are going to be much slower than local operations, but where's the time going? Is it mostly the network latency? Google has a lean webpage, so I assume it has nothing to do with google specifically.