ちょっと思うところがあって、GCC と LLVM、 それぞれで作成した実行ファイルの速度差を調べてみた。
テスト環境は iBook。
SRILM ver.1.5.9 のテスト用ソースを使った。
なお、コンパイル・オプションは
-O2 -mtune=G4 -mpowerpc -maltivec -mabi=altivec -pipe
とした。
$ g++-4.2 --version powerpc-apple-darwin9-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5566) [...] $ make SRILM=`pwd` $ ( cd test/ && make SRILM=`pwd`/.. ) [...] 1144.315u 306.865s 27:20.42 88.4% 0+0k 0+750io 162pf+0w
$ /Developer/usr/llvm-gcc-4.2/bin/llvm-g++-4.2 --version powerpc-apple-darwin9-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5555) (LLVM build 2056) [...] $ make SRILM=`pwd` $ ( cd test/ && make SRILM=`pwd`/.. ) [...] 1143.344u 305.368s 27:15.30 88.5% 0+0k 1+753io 266pf+0w
LLVM のバイナリが勝ってるけど、ほとんど差がない。 テスト環境が悪いのか? SRILM を選択したのが悪いのか? もう少し追ってみたい。
CFLAGS
はお好みで。
$ wget -c http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.1.tar.gz $ gzip -cd gc-7.1.tar.gz | tar xvf - $ cd gc-7.1/ $ wget -c http://quruli.ivory.ne.jp/download/gc-7.1.diff.gz $ gzip -cd gc-7.1.diff.gz | patch -p1 $ ./configure --enable-cplusplus $ make && make check $ sudo make install
csh 系の多機能シェル。
Red Hat Enterprise Linux を基礎とした Linux ディストリビューション。