kpathsea: Slow path searching
8.5.2 Slow path searching
-------------------------
If your program takes an excessively long time to find fonts or other
input files, but does eventually succeed, here are some possible
culprits:
* Most likely, you just have a lot of directories to search, and that
takes a noticeable time. The solution is to create and maintain a
separate 'ls-R' file that lists all the files in your main TeX
hierarchy. ⇒Filename database. Kpathsea always uses 'ls-R'
if it's present; there's no need to recompile or reconfigure any of
the programs.
* Your recursively-searched directories (e.g.,
'/usr/local/share/texmf/fonts//'), contain a mixture of files and
directories. This prevents Kpathsea from using a useful
optimization (⇒Subdirectory expansion).
It is best to have only directories (and perhaps a 'README') in the
upper levels of the directory structure, and it's very important to
have _only_ files, and no subdirectories, in the leaf directories
where the dozens of TFM, PK, or whatever files reside.
In any case, you may find the debugging options helpful in
determining precisely when the disk or network is being pounded. ⇒
Debugging.