Reply To: Search Loading Speed Too Slow


Ernest Marcinko


I was checking the other search bar, that's why I was getting the wrong results.

Also, I have found the source of the problem. After some stress testing I was able to reach the server resource limit. I will try to explain what happened when the response time was higher:
I'm guessing you are on a shared hosting provider. They usually have a very strict limit for running processes, usually 10 or 20. Since the “Trigger search when typing?” option is enabled, the search starts after a low delay when the user starts typing – sending a request to the server. When the typing continues and the results didn't arrive, the plugin tells the server to abort the previous request and deal with the new one, to save as much resource as possible. The autocomplete is a separate process, so it does similarly. So when typing for example “vacant” at a regular typing speed, the server recieved 4 + 6 requests when the final character “t” is reached. However if the resource limit is 10 and the first 9 processes were not aborted yet for some reason, this creates a huge delay – as the shared server must deal with other customers requests as well, running on the same server.
This is how every (quality) ajax search plugin works, including google itself. (but they have an extremely powerful environment, so there is essentially no delay)
Also, this explains why the performance tracker reported such fast speeds – the process itself was executed fast, but it was delayed.

The solution
Knowing this problem the best option is to minimize the request count to the server.
1. I have disabled the “Trigger search when typing?” option. The search won't start until the user presses enter. This will save huge amounts of server performance.
2. I have yet disabled the autocomplete feature – but you should try testing it, maybe it does not affect the performance that much.
3. I have configured the Index Table engine and enabled it for the top bar search. I recommend doing that for the rest of the search instances.

Here is a video of the optimized search speed:

Ernest Marcinko

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