Thu, 11 Aug 2016 09:27:28 +0800
Performance of mod operation for long type is 100% up.
public class Test {
public static void main(String[] args) {
long LEN = 65000000;
long result = 0;
for(long j = 1; j < 20; j++) {
result = 0;
for(long i = 1; i < LEN; i++){
result += i % (j + 1);
}
}
System.out.println("result = " + result);
}
}
aoqi1986@22 | 1 | f90c822e73f8f30ebfc930bdffc6263a99aec49f jdk8u25-b17 |
aoqi1986@23 | 2 | 2d8a650513c2c3e6717fcbfe5d4f12abee5ff96b mips64-jdk8u25-b17-rc1 |
aoqi1986@24 | 3 | afa196fe1bf669c34fe9acb7ebb31aabc8f0437a mips64-jdk8u25-b17-rc2 |