views:

93

answers:

3

I am trying to build an auto-complete text box which will give results in about 100ms. I have checked Google with firebug it is 74ms, stackoverflow has 500ms.

I am using drupal6 and it is taking 800ms for auto complete which is not useful at all.

Can anybody suggest to me how I can build an auto-complete with a response time of under 100ms? I'm using mysql as database.

Thanks in advance.

+2  A: 

The only way to do this is to profile and see where the time is going.

Firebug is a good start - is the time take on posting back? Generating the response? Rendering the response?

If it's in generating the response then try xdebug or just printing out some timer statements. MySQL queries are a likely place for slowness - EXPLAIN your queries if they are slow.

Greg
A: 

Firstly you should to find bottle neck. Is it network leaks or slow query processing.

If the query on the server processes fast you should to use more powerfull enviroment with a short network leaks. Another way, you should to optimize perfomance of your system following the drupal6 documentation. For example, make sure that debug mode is turned off.

Max
+1  A: 

I'd imagine your database is likely to be your bottleneck. If your data set is small enough, consider using memcached to hold as many of your common queries as possible.

Paul McMillan