in reply to Using FastCGI

If you want to speed up a script, don't make changes based on hearsay. Use a profiler (like Devel::NYTProf) to find the things that are slow, and try to improve those.

I guess in your case it's reading the files that is slow, but don't rely on my guessing - do the analysis yourself.

For searching things, there are various fast, pre-made solutions. For example KinoSearch lets you build a so-called "inverted index" from documents in which searching for words is much faster than reading all the documents when you want to search them.

Replies are listed 'Best First'.
Re^2: Using FastCGI
by jonc (Beadle) on Jun 15, 2011 at 02:18 UTC
    Thanks a lot, I had never heard of this 'profiling', should definitely get me started in the right direction. I was thinking of eliminating the loop to read files, by just joining all the files together, so we'll see.