Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Almost everything is faster if you can precompute.


For sure, but the approach is quite viable. If 19 out of 20 searches by a user are almost instantaneous and single novel one requires a few seconds, they'll assume a hiccup in their internet connection and still view the site as "really fast". It's certainly useful for limiting demands on expensive hardware.


20% of all Google searches are brand new


Then 80% aren't, and those ones will perform very well.


The other 20% also perform well. I have quite literally never encountered a Google search that took more than some tens of milliseconds for a round trip.


You're absolutely correct. Caching common search queries allows the site to allocate hardware for processing "expensive" queries, with the objective of having both complete at near the same time.

Without caching, the cost of operating the site would dramatically escalate.


And use 80% of the resources?


Eh, a non trivial % of those are likely just brand new misspellings.


Yup, all FastComments threads are precomputed for all sort directions! Each page comes from the DB in < 1.5ms 75% of the time.

It gets tough with pages with 100k+ comments though, so there are different tricks and switches for different flows and data sizes.


Your site is killing me. Every page I visit I have to accept the cookies :(


Fixed. Was an issue specific to certain countries - my bad!


Oh, that's weird...


I recall reading about the local transit department which had gotten some fancy accelerator card to help with route searches, ie when a customer wanted to go from A to B, which busses, trams etc to take.

Can't recall if it was "just" a bunch of FPGAs but it was a big-ass PCI card.

Some years later I tried to find this story again, and to check if they still used it. Turned out they had ditched it after just a couple of years. As memory sizes had increased, they could just precompute all possible routes for the next day and keep them all in memory...


which is why es uses multiple levels of caching




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: