Menu

#2356 luatex and slow file searches for unknown files

fixed
luatex (4)
2015-04-01
2015-03-24
U_Fischer
No

When I compile this document with lualatex (0.79.1)

\documentclass{article}

\begin{document}
\InputIfFileExists{unknown}{true}{false}
\end{document}

I can see in the process monitor around 2000 events with "NAME NOT FOUND". Lualatex is really looking almost everywhere for the file. One example line of the monitor is:

13:03:53,3383710    lualatex.exe    7056    QueryOpen   D:\MiKTeX2.9\tex\latex\algorithms\unknown.tex   NAME NOT FOUND      0.0000105

pdflatex or xelatex creates only one line:

13:05:19,1731388    pdflatex.exe    5940    QueryOpen   G:\Z-Test\unknown.tex   NAME NOT FOUND      0.0000094

It looks as if luatex is not relying on the FNDB when it can't find a font.

I can't test if the problem is specific to the new luatex version or did always exists.

This files searches are quite problematic as with fontspec lualatex has to look for a lot of optional files. In one case I could cut down the compilation time from 12 to 2 seconds simply by removing an equivalent of \InputIfFileExists in the fontspec code.

Discussion

  • Christian Schenk

    I have checked the source code: luatex always tries hard to find an \input or \read file. In MiKTeX land, this means that the disk is searched.

     
  • Christian Schenk

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     When I compile this document with lualatex (0.79.1)
    
     ~~~~~
    
     
  • Christian Schenk

    • labels: --> luatex
    • status: open --> in-the-works
    • assigned_to: Christian Schenk
     
  • U_Fischer

    U_Fischer - 2015-03-25

    In TeXlive lualatex (and pdflatex) does some disk search too. But one can forbid this for most texmf trees by using "!!" in the texmf.cnf. So in texlive I have only around 50 events compared to 2000 in miktex -- and this isn't a full miktex installation. Could you tell me where in the sources the disk search is triggered? Then I could discuss it on the luatex list.

     

    Last edit: U_Fischer 2015-03-25
  • Christian Schenk

    The search is triggered in the function luatex_find_read_file which is defined in the source file texfileio.w.

    I have attached a preliminary bug fix for luatex_find_read_file in MiKTeX.

     

    Last edit: Christian Schenk 2015-03-25
  • U_Fischer

    U_Fischer - 2015-03-25

    Seeing your patch: Is there a need or would it make sense if the luatex source are adapted somehow? Or is this a patch that you would have to do always in the miktex sources?

     
  • Christian Schenk

    If the bug (I think it is a luatex bug) isn't fixed upstream, it is relatively easy for
    me to apply the patch to any future luatex release.

    If the bug fix is okay, I will send the patch to the luatex-dev list. Please feel free to discuss the issue on the luatex user list.

     
  • Christian Schenk

    If you don't object, I will close the ticket (the bug has been fixed).
    I will send a patch to the luatex-dev mailing list within the next days.

    Thank you for the valued bug report!

     
  • Christian Schenk

    • status: in-the-works --> fixed
     
  • U_Fischer

    U_Fischer - 2015-04-01

    Naturally I don't object. I always thought that you are the only one who can close bug reports. If not I will have to check some of my reports which have been fixed in the meantime ...

    Thank you very much for the fast fix - the gain time is really noticable. I will check the luatex list and if I can do something to clarify the problem I will do it, but imho it is at first best if there is no middleman confusing things.