Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000] "EnableULPS"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0001] "EnableULPS"=dword:00000000
@Before publicvoidinit(){ longs = newlong[DIMENSION_1][]; for (int i = 0; i < DIMENSION_1; i++) { longs[i] = newlong[DIMENSION_2]; for (int j = 0; j < DIMENSION_2; j++) { longs[i][j] = 0L; } } }
@Test publicvoidslow(){ long sum = 0L; for (int r = 0; r < RUNS; r++) { finallong start = System.nanoTime(); for (int j = 0; j < DIMENSION_2; j++) { for (int i = 0; i < DIMENSION_1; i++) { sum += longs[i][j]; } } System.out.println((System.nanoTime() - start)); } }
@Test publicvoidfast(){ long sum = 0L; for (int r = 0; r < RUNS; r++) { finallong start = System.nanoTime(); for (int i = 0; i < DIMENSION_1; i++) { for (int j = 0; j < DIMENSION_2; j++) { sum += longs[i][j]; } } System.out.println((System.nanoTime() - start)); } } }