Hello,
Simetrical wrote:
On 8/3/06, Julien Lemoine speedblue@happycoders.org wrote:
The algorithm uses very few cpu power. Imagine for example that all the data needed are in memory, the compiled automaton could be obtained in 1 minutes.
Okay, that's good. But what I meant was, how much CPU power (and other resources) will the suggestion feature eat on a day-to-day basis? I start typing "Metasyntactic variable" into the search box, it helpfully provides some suggestions based on its index — how much resources did that just use? When thousands of people are doing it every minute, how much will that slow down the servers compared to the normal load of page views and edits and so on?
The search uses very few resources (only RAM to store the index). The complexity in the worst case is O(log(A) * P) where A is the number of letter in Alphabet and P the size of the word to search.
I wrote two implementations : - monothreaded with index stored on disk (I implemented it for my server because I have few RAM available) - multithreaded version with all index in RAM
With the second one, you will be able to handle a lot of queries per second with very few cpu power.
Best Regards. Julien Lemoine