指摘が多い内容/プログラム編
• Iterator
23
Long2LongMap map1;
for (Map.Entry<Long, Long> entry : map1.entrySet()) {
Long k = entry.getKey();
Long v = entry.getValue();
}
ObjectIterator<Long2LongMap.Entry> itr =
map1.long2LongEntrySet().fastIterator();
while (itr.hasNext()) {
Long2LongMap.Entry e = itr.next();
long k = e.getLongKey();
long v = e.getLongValue();
}
性能問題
• Objectを作りすぎない
54
class Points {
int[] xx;
int[] yy;
}
これで同じ事が出来る
class Point { int x; int y }
ImmutableList<Point> points; // 10万要素あると10万Object生成
JVMの外の話
• TCP Offload
– OFFにしないとxenのネットワークドライバの不具合を
踏む事がある
– (最近のでは直っていると思う。たぶん。)
• RabbitMQでMirror設定を入れるとこれを踏んで
Panicを起こす事があった
66
for path in /proc/sys/net/ipv4/conf/*
do
nic=$(basename "$path")
if [[ $nic == eth* ]]; then
/sbin/ifconfig $nic txqueuelen 10000
/sbin/ethtool -K $nic ¥
rx off tx off sg off tso off ufo off gso off gro off lro off
fi
done