Re: Live Search
| From: | Hannes Magnusson | Date: | Wed, 09 Dec 2009 13:37:23 +0000 |
| Subject: | Re: Live Search | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.webmaster |
| Request: | Send a blank email to php-webmaster+get-6699@lists.php.net to get a copy of this message | ||
On Wed, Dec 9, 2009 at 09:19, Stewart Lord <stewey@ambitious.ca> wrote:
> On 5-Dec-09, at 4:09 AM, Hannes Magnusson wrote:
>>>
>>> Thanks Hannes, this is helpful. Rendering the docs would be a good
>>> exercise. Can you point me in the right direction?
>>
>> http://wiki.php.net/doc/phd
>
>
> Hi Hannes,
>
> I was able to build the docs and make use of the PHD database as you
> suggested. PHD worked great BTW :) ...I have posted a version of the
> search-api script to pastebin:
>
> http://pastebin.com/m2da3e823
>
> This version runs much faster than the manual-lookup.sqlite version, but
> still about 50% slower than the original, averaging ~48ms/request. I don't
> know how this would perform on the mirrors. Based on my earlier tests, maybe
> around 150ms. Playing with other sites that do auto-complete (Google, Apple,
> Hulu, Bing) I found response times typically between 30-90ms.
Considering the "original" does over 7000 stat()s per request I can't
believe a sqlite search on a small database can possibly be that slow.
Are you 100% sure these numbers are accurate?
> Should we go with this direction or the (dumber) faster version that doesn't
> use a database?
We could offload some of the searching to the client itself,
populating things like function/method index into json objects and
cache it on the client, similar to what we do on http://people.php.net
That should drastically speed up the basic search.
We could look into how much data we can push to the client gzipped..
> It might be worthwhile to put together some of the front-end pieces and try
> it out. There is no longer an official autocomplete plugin for jQuery (as of
> 1.7), but this one (http://plugins.jquery.com/project/autocompletex) looks
> promising.
Sounds good to me, but we still haven't restructured the website..
Searching may be the most fun thing to work on, but we still need all
the other pieces :)
-Hannes