我不太确定从哪里开始解决这个问题。我最近从旧的 Ubuntu 14.04 机器迁移texlive/2012
到运行 18.04 机器texlive-2018
。
旧盒子
pdfTeX 3.1415926-2.4-1.40.13 (TeX Live 2012)
kpathsea version 6.1.0
Copyright 2012 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.5.10; using libpng 1.5.10
Compiled with zlib 1.2.7; using zlib 1.2.7
Compiled with xpdf version 3.03
新盒子
pdfTeX 3.14159265-2.6-1.40.19 (TeX Live 2018)
kpathsea version 6.3.0
Copyright 2018 Han The Thanh (pdfTeX) et al.
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.34; using libpng 1.6.34
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.00
tex 文件包含相当多的图像,这似乎是导致速度减慢的原因(编译没有图像的文件相当快)
我正在传递一个格式文件,但基本上两个作业都是这样调用的:
pdfetex --output-format=pdf -fmt=$fmt_path -no-shell-escape -output-directory=$out_dir filename.tex
有人能提示一下从哪里开始寻找答案吗?
我也压缩 2012 目录从旧盒子中取出,然后将其移到新盒子上,然后运行它。任务在 2.2 秒内完成在新盒子上。所以这不是磁盘或机器的问题,而是与 2012 年和 2018 年有关。
我在日志中看到的是 2018 版本只是慢了很多处理图像。至少,打开详细模式后,我可以看到每幅图像大约需要 600 毫秒。
抱歉,这个问题问得比较模糊,但如果能得到任何帮助我将非常感激!
更新 - 2018 年 8 月 20 日
我又做了一些调查。
- 问题不在于 png。我创建了一个包含以下内容的文档:只是png(我们有几种不同的
figure
类型)并且它们在 2012 和 2018 版本上的渲染速度都相似。 - 我创建了一个文档,其中包含大部分损坏的图像链接。这个文档很有趣,因为使用 2012 构建损坏的文档大约需要 0.2 秒,但差不多 8 秒在 2018 年构建相同的损坏文档。这表明在文件搜索方面存在一些非常低效的问题。
无论如何,继续调查。
Kpath 调试
我不认为这实际上就是这样,但是,这是在 2012 年和 2018 年之间注销搜索的区别(对于同一个文件)
2012
(apppath/texinput/tex/EA910706.FIG)kdebug:hash_lookup(openin_any../acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(openin_any) => a
kdebug:hash_lookup(try_std_extension_first../acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(try_std_extension_first) => t
kdebug:hash_lookup(openin_any../acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(openin_any) => a
kdebug:hash_lookup(try_std_extension_first../acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(try_std_extension_first) => t
2018
(apppath/texinput/tex/EA910706.FIG)kdebug:hash_lookup(openin_any.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(openin_any) => a
kdebug:hash_lookup(try_std_extension_first.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(try_std_extension_first) => t
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(openin_any.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(openin_any) => a
kdebug:hash_lookup(try_std_extension_first.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(try_std_extension_first) => t
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
kdebug:hash_lookup(texmf_casefold_search.formatpath/acc4-pdf.fmt) => (nil)
kdebug:hash_lookup(texmf_casefold_search) => 1
答案1
对我们来说,罪魁祸首是大小写(不敏感)搜索,这kpathsea
在 2018 年已成为默认设置。感谢 @moewe 的指点。
修复方法是将以下内容添加到我们的texmf.cnf
文件中:
texmf_casefold_search = 0
此后,我们所有的 pdftex 作业都以我们习惯的速度进行编译。