ルギア君の戯言

雑多な記事。

6年12月13日 (水) - TeX Live 20100722 + e-pTeX 20110315 奮闘記 その 3

みんな「みーっつ! みんな笑顔で明るいあるぱ城!」
ドンちゃん「よし、今日も仕事始め!」


……………


ルギア君「『あれ』に1時間以上かかってた気がするがなんだったんだろう。」
キリルン「何が?」
ルギア君このスクリプト。」
キリルン「なんでそんなに掛かってたんですか?」
ルギア君「このファイルリスト達のうち、」

$ ls -trl | head
合計 6524
-rw-r--r--. 1 lugia users   182  6月 11 11:26 doc-files
-rw-r--r--. 1 lugia users   771  6月 11 11:26 dvipdfmx-files
-rw-r--r--. 1 lugia users   203  6月 11 11:26 cjkutils-files
-rw-r--r--. 1 lugia users   188  6月 11 11:26 detex-files
-rw-r--r--. 1 lugia users   235  6月 11 11:26 lcdf-typetools-files
-rw-r--r--. 1 lugia users   300  6月 11 11:26 ttf2pk-files
-rw-r--r--. 1 lugia users  4066  6月 11 11:26 kpathsea-files
-rw-r--r--. 1 lugia users   670  6月 11 11:26 bibtex-files
-rw-r--r--. 1 lugia users   753  6月 11 11:26 dvips-files
$ ls -trl | tail
-rw-r--r--. 1 lugia users   254  6月 11 12:17 fonts-punk-files
-rw-r--r--. 1 lugia users   222  6月 11 12:17 fonts-simpsons-files
-rw-r--r--. 1 lugia users   254  6月 11 12:17 fonts-xbmc-files
-rw-r--r--. 1 lugia users   388  6月 11 12:17 fonts-zhmetrics-files
-rw-r--r--. 1 lugia users   199  6月 11 12:17 cidmaps-dnp-files
-rw-r--r--. 1 lugia users   217  6月 11 12:17 cidmaps-fontforge-files
-rw-r--r--. 1 lugia users   289  6月 11 12:17 encoding-c90-files
-rw-r--r--. 1 lugia users   278  6月 11 12:17 encoding-ly1-files
-rw-r--r--. 1 lugia users 32921  6月 11 12:17 generated-file-list

ルギア君「最初が 11:26 で最後が 12:17 ってなっているということは、掛かった時間はおよそ 51 分だろう?」
キリルン「そうですねぇ。」
ルギア君「同じことするプログラムを C++ で実装したんだが、どれくらい掛かったと思う?」
キリルン「だいぶ速くなりそうだけど。」
ルギア君「だいたい 30 分。驚くほど速くはないね。」
キリルン「そうだね。で、その 1 時間以上かかっていたっていうのは…?」
ルギア君ファイルシステムはこの時も ext4 だったのは確か *1 なんだ。だから、ファイル操作の実行効率が向上したか、bash の実行速度が向上したか、あるいは、…」
キリルン「あるいは…?」
ルギア君「kernel の実行速度が向上したかな。」
キリルン「ああ、シェルスクリプトの場合は大半がプログラムのロードとかだからか…。」
ルギア君「うむ。あとは、1コアで実行しているっていうのもあるかもね。」
キリルン「パイプは自動的に別の空いているコアに割り当てられて行きますからね。」
ルギア君「これも pthread あたりを使って並列化するか。」
キリルン「そんなところあるんですか?」
ルギア君「あるよ。」
キリルン「ふうん。」
ルギア君「なんつったってこのプログラムはループ数だけで O(N_{packages}\times N_{packages}\times N_{files}) 以上もあるからな。そして1つ1つのルーチンの中に正規表現の処理などの比較的重そうな処理もしているからな。」
キリルン「大変ですね。」
ルギア君「あと、気になったのは、スクリプトにはなかった、新しい機能を追加してみたんだが。」
キリルン「なに?」

################################################
# Package Inspection Result Summary
################################################
# Warning: latex-sfmathtaupin does not contain any files.
# 
(以下略)

ルギア君「これは、 TeX Live 2009 の奴を新しいプログラム用に作成しなおして、処理させてみたのだが、そこに書いてあるように、latex-sfmathtaupin には何もファイルが含まれない、と言っている。それで見てみたんだが、」

$ rpm -q texlive-texmf-latex-sfmathtaupin
texlive-texmf-latex-sfmathtaupin-2009-25m.mo7.noarch
$ rpm -ql texlive-texmf-latex-sfmathtaupin
(contains no files)

ルギア君「この通り空っぽだったというわけだ。」
キリルン「それより、そういえば pxdvi がビルドされていないって言ってたけどそれはどうなったの?」
ルギア君「やってない。」
キリルン「やってください。」
ルギア君「そうだねー。まあ、でも、パッチ作った時に必要なところも消しちゃったっていうだけだと思うから、大したことじゃない。」
キリルン「そうなんですか?」
ルギア君「ほら。」

[lugia@arpa-castle texlive-20100722-source]$ ./configure --help
`configure' configures TeX Live 2010-07-20 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...
(中略)
  --disable-seetexk       do not build the seetexk package
  --disable-tex4htk       do not build the tex4htk package
  --disable-ttf2pk        do not build the ttf2pk package
  --disable-ttfdump       do not build the ttfdump package
  --disable-xdv2pdf       do not build the xdv2pdf package
  --disable-xdvik         do not build the xdvik package
  --disable-pxdvik        do not build the pxdvik package
  --disable-xdvipdfmx     do not build the xdvipdfmx package
  --disable-tetex         do not build the tetex (teTeX scripts) package
  --disable-texlive       do not build the texlive (TeX Live scripts) package
  --disable-mktexmf-default   do not run mktexmf if MF source missing
  --disable-mktexpk-default   do not run mktexpk if PK font missing
(後略)

キリルン「ここには入っているんですね。」
ルギア君「だから、Makefile.in とかもっと別のところ。」
キリルン「なるほど。」
ルギア君「んー、ここかなー。」

$ pwd
/opt/Momonga/pkgs/texlive/BUILD/texlive-2010/texlive-20100722-source/texk
$ cat Makefile.in
(前略)
        $(top_srcdir)/../texk/tex4htk/ac/withenable.ac \
        $(top_srcdir)/../texk/ttf2pk/ac/withenable.ac \
        $(top_srcdir)/../texk/ttfdump/ac/withenable.ac \
        $(top_srcdir)/../texk/xdv2pdf/ac/withenable.ac \
        $(top_srcdir)/../texk/xdvik/ac/withenable.ac \
        $(top_srcdir)/../texk/xdvik/ac/xdvik.ac \
        $(top_srcdir)/../texk/xdvipdfmx/ac/withenable.ac \
        $(top_srcdir)/../texk/tetex/ac/withenable.ac \
        $(top_srcdir)/../texk/texlive/ac/withenable.ac \
        $(top_srcdir)/../libs/icu/ac/withenable.ac \
(後略)

ルギア君「でも、どこを弄れば良いかわからないんだよね。」
キリルン「だったら直接弄れば良いじゃないか。」
ルギア君「まあ、それも試してみるか。」
キリルン「がんばれー。」

*1:Mo7 を[]クリーンインストール[]しているため忘れた