Reply To: Speed of Search.

#14666

Ernest Marcinko
Keymaster

Hi Paul,

There are major differences between the two pages there:

1. They do not use WordPress, but a custom built platform. It is quite possible that they are running a different server side scripting language than PHP. This alone can make an incredibly huge difference. WordPress is really great in terms that it can be used to easily create websites, however there is a huge amount of overhead code, that is not used in each specific case. I would say that over 90% of the code is arbitrary depending on the situation. But this is the price to use such a flexible system.

2. They seemingly have a dedicated server (or a powerful VPS) running, that handles the AJAX requests, possibly with load balancers involved. Their response times are below 80ms, which is far below any wordpress ajax request timeout I have ever seen in my life. The fastest real life example was probably around 250ms or so. Anything around 1 seconds response time I would consider very fast, and around 2-3 seconds is still fairly normal. The back-end script handling these requests must be specialized to this task only, there is no overhead code running. While in WordPress for each ajax request the whole system is initialized, increasing the response time and the server load greatly.

3. Their data set might be very limited, and might as well not use any database at all for these requests – reducing the response time and server load even more. So if there only a small script accepting a search query argument that simply selects data from a file or from hard-coded data (or some sort of cache), then it is going to be really fast.

These are just a few things that came to my mind, but it is probably much more complicated, but this is how I would do it, if I was to create a dedicated project for a site. However there is a definitive price gap between the two solutions as well.

A seemingly 'instant' search is something that everyone desires, but for now there is no reliable solution for WordPress because of the platform and an average user server limitations. Some search engines offer a 3rd party service, so you basically pay a fee, and the your site is indexed, and the search plugin uses their servers to do the search for you. It is great, but very costly.
Another possibility is to build an 'instant' search, that uses the browser to do the actual work, bypassing the server, but that is even more complicated, and limited in many ways. I'm actually working on something similar, will see how it turns out.

I would recommend researching 'instant search' plugins. If you don't have lots of records, like a few hundred or so, then it might be the best solution. Otherwise I believe only 3rd party search services can offer such speeds for WordPress systems.

Sorry for the long response 🙂

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)