!分岐するプログラムの速度(gcjで) {{category Java}} [分岐するプログラムの速度|Diary/2007-12-11]のプログラムをgcjでコンパイルして実験。 ./a.out 0 10 1000000 > /dev/null 1.75s user 1.31s system 90% cpu 3.388 total ./a.out 1 10 1000000 > /dev/null 2.10s user 1.35s system 99% cpu 3.452 total ./a.out 2 10 1000000 > /dev/null 1.78s user 1.32s system 99% cpu 3.105 total おおお、うれしい。 普通に実行した場合と違って、 複数の異なる機能を持つインスタンスを切り替える場合より 毎回switchで分岐した場合のほうが速いのも特徴か、な。