では、Javaの場合の行列式計算を実行し、そのprofileを見てみよう。
まずは最適化無しで実行してみる。
java -Xprof -Xint Test
結果は以下のようになった。
result: 489261678 Flat profile of 90.10 secs (5728 total ticks): main Interpreted + native Method 99.1% 5204 + 454 Test.expand 0.0% 0 + 1 java.io.FilePermission$1.run 99.1% 5204 + 455 Total interpreted Thread-local ticks: 0.3% 18 Blocked (of total) 0.0% 1 Class loader 0.3% 17 Interpreter 0.6% 32 Unknown: running frame 0.0% 1 Unknown: thread_state Global summary of 90.10 seconds: 100.0% 5766 Received ticks 0.5% 26 Received GC ticks 0.2% 9 Other VM operations 0.0% 1 Class loader 0.3% 17 Interpreter 0.6% 33 Unknown code
Cのものの時もそうだったが、今回のプログラムも計算結果を標準出力に出すので、profileの先頭に結果が出ているのが分かる。
計算し終わるのに、約90秒かかったようである。
処理のほとんどはexpandメソッドに費やされており、その内訳は分からない。
これは、後々検証するときに、内容を何らかの形で切り分けなければならないだろう。
次回は、最適化を行った場合のprofileを見てみよう。