in reply to Code Efficiency
You say "new keywords can be added at any time." What about changing and deleting? If you only have keywords added, then you could optimize (for time) very efficiently by just detecting what new keywords show up and then inserting them into the sorted list. For instance, make a cache (copy) of the tree and compare the old vs. the new.
The next optimization step: Keep a timestamp (and/or hash) of every file instead of a copy. Since you are only adding keywords, any time a file changes, dump its whole contents into the sorted list.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Code Efficiency
by fourmi (Scribe) on Mar 26, 2004 at 11:24 UTC |