Am I the only person here who wasn’t thinking about the frontend, but rather all the things that need to happen in the backend to render the search results?<p>To me it feels like an oversight when answering the question “how the hell is Google so fast?” and not digging into how Google is able to return the results to your actual search query in a matter of milliseconds. That, to me, is the real miracle.
When I think of "fast", I always think of a time I was building a product that required subscribing to Twitter's API to receive updates from specific users.<p>In my testing, I'd set a breakpoint on my server code to see when I'd get the "push" from Twitter's API and would use the Twitter App on my phone to create test tweets. Every single time, I'd create a tweet and my server breakpoint would be hit immediately. Not soon, but immediately. I'd see my breakpoint triggered well before the UI in the app even refreshed after submitting the tweet.
One factor that is missing from this post is the processing time on the backend which is also insanely fast. This post only considers frond-end optimizations.<p>On the author's benchmark, a roundtrip seems to take on average 30ms, and the time to first byte for the main content is around 140ms. Which means that in less than 110ms Google is able to parse the search query, and build the HTTP response.<p>I'm sure they are heavily relying on caches and other optimizations, and for tail-end requests the result might not be as impressive. But compared to many other websites in 2020 this is still unfortunately not the norm.
I have a related question. How is instacart so slow? I am usually pretty unbothered by slow load times, but searching for and selecting groceries is a full 10 times slower than <i>any other experience</i> on the internet. Is this a deliberate push to get me to use the mobile app? Some dark pattern thing?
It feels fast because most other sites are insanely slow.<p>Just build a normal HTML+CSS+JS site with serverside rendering, route the assets through a CDN and voila! your site will be just as "fast" as Google.
You can make Google searches plenty slow if you Google something uncached.<p>I just Googled: the OR google OR a OR badger -the -google -a<p>it took: 5.66 seconds.<p>This is probably cached now so don't try it yourself, replace badger with some other weird word. :)
If you inline everything then you can’t take advantage of caching those resources. I wonder if there is a fancy way to inline the resources and then somehow use JS to cache the data, set a cookie and then on the second page load it’s even faster because you don’t have resend the inlined stuff.
Doesn't come as surprising to me honestly. Besides performance reason, inlining everything also minimizes your dependencies as well, and now you can make sure what you send out is what user would be able to see.<p>I can also see how this makes integration testing magnitude easier/effective.
Climb to the top of a mountain in the USA (or live in the countryside of a developing country), where you can only get 1 bar of 3g service.<p>Then try to load <a href="https://cr.yp.to" rel="nofollow">https://cr.yp.to</a><p>Ok now try to do a google search for dog food.<p>Tell me which one executes in less than a second, and which one hangs forever
Honestly, Google is one of the modern marvels, even when I read the article and understand _why_ Google is so fast, I still cannot comprehend it.<p>To people over 30 years ago, this is a literal example of magic.
> How is Google so fast?<p>It is not. At least not in the way the article is talking about. So while yes, requests are fast, it doesn't really feel that way when I can't click anything for a good second after hitting search.<p>My browser takes roughly half a second crunching JavaScript, doing layout, and drawing the result page AFTER doing a whole boatload of HTTP requests. Annoyingly half that JavaScript runs AFTER the page is rendered (150ms-200ms of JS functions when I can already see results, why?), making the page appear to lag if you immediately try to click/tap something.<p>If they would serve the page as static html and css instead, load times could easily be below 50ms with another 20ms for my browser to present me with something that is interactive right away.<p>The impressive part is how fast they generate results.