19. その3: 細かいオプション
OptimizeFill
◦ java.util.Arrays.fill()のような、単純な配列書き
込みループをVMの最適化済みメソッドの置換する
◦ JDK7 RIではSSE命令(MOVDQUなど)を使ったメモリ転
送命令に置換される
◦ サポートされるプリミティブ型のビット幅は32bitまで
/**
* Assigns the specified int value to each element of the specified array
* of ints.
*
* @param a the array to be filled
* @param val the value to be stored in all elements of the array
*/
public static void fill(int[] a, int val) {
for (int i = 0, len = a.length; i < len; i++)
a[i] = val;
}
UseFPUForSpilling
◦ スタックメモリアクセスで浮動小数レジスタ(SSEの場合
はXMMレジスタ)を積極的に活用
◦ GPRを使い切るような、ローカル変数が多数登場する場合
に効果が見込める
28. 今回使わせていただいた資料
Everything I Ever Learned About JVM Performance Tuning at Twitter
https://oracleus.wingateweb.com/published/oracleus2011/sessions/37941/S37941_2408980.p
df
Every Last Nanosecond: Tuning the JVM for Extreme Low Latency
https://oracleus.wingateweb.com/published/oracleus2011/sessions/20262/20262_Cho144249.
pdf
From Java Code to Java Heap: Understanding the Memory Usage of Your
Application
https://oracleus.wingateweb.com/published/oracleus2011/sessions/24001/S24001_138281.pd
f
Attack on Scaling: Methods and Tools for Eradicating Performance Bottlenecks
https://oracleus.wingateweb.com/published/oracleus2011/sessions/20580/20580_Cho156823.
pdf
Blazing JVM Performance: Trends Fueled by the Latest Hardware and JVM
Optimizations
https://oracleus.wingateweb.com/published/oracleus2011/sessions/18540/S18540_2625060.p
df
Java or C++: Practical Advice You Can Use
https://oracleus.wingateweb.com/published/oracleus2011/sessions/24029/S24029_239397.pd
f