[dokuwiki] [PATCH] Limiting use of readdir in the idx_indexLengths function.

  • From: YoBoY <yoboy.leguesh@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 20 Mar 2010 20:21:57 +0100

This is a multi-part message in MIME format.
Hi,

Each searches on the wiki use this function. Scanning the index directory each time is time consuming with a constant series of disk access. Switching a normal search to use file_exists 1 or more times, and not readdir all the directory. Switching a wildcard search to use a lengths.idx file containing all the word lengths used in the wiki, file generated if a new configuration parameter $conf[readdircache] is not false and fixed to a time in second.

I write also the simpletest to see the time improvments on my local install. I think it's not really good but it tests also the function works like expected.

Thanks

YoBoY











Other related posts: