摘要: 一、避免在循环条件中使用复杂表达式(转载来自chinaifne的java程序性能优化)在不做编译优化的情况下,在循环中,循环条件会被反复计算,如果不使用复杂表达式,而使循环条件值不变的话,程序将会运行的更快。例子:import java.util.vector;class cel { void method (vector vector) { for (int i = 0; i 10, vector needs to expand for (int i = 0; i> 2". int div2 = a / 8; // shoul... 阅读全文
posted @ 2012-12-24 16:41 可可ing 阅读(144) 评论(0) 推荐(0) 编辑