2013年11月15日

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; // should be replaced with "a >> 3... 阅读全文

posted @ 2013-11-15 13:17 风若遥音 阅读(349) 评论(0) 推荐(0) 编辑

导航