6162636465666768697071
timer.start(); for (int k = 0; k < COUNT; k++) { // baseline } timer.stop(); nanos = timer.nanoTime() / COUNT; log.info("baseline nanos={}", nanos); timer.start(); for (int k = 0; k < COUNT; k++) {
7071727374757677787980
timer.start(); for (int k = 0; k < COUNT; k++) { // small array final byte[] array = new byte[128]; } timer.stop(); nanos = timer.nanoTime() / COUNT; log.info("make array 123; nanos={}", nanos); timer.start(); for (int k = 0; k < COUNT; k++) {
7980818283848586878889
timer.start(); for (int k = 0; k < COUNT; k++) { // medium array final byte[] array = new byte[1024]; } timer.stop(); nanos = timer.nanoTime() / COUNT; log.info("make array 1024; nanos={}", nanos); final int[] arrayInt = new int[SIZE]; timer.start();
8889909192939495969798
final int[] arrayInt = new int[SIZE]; timer.start(); for (int k = 0; k < COUNT; k++) { Arrays.fill(arrayInt, 1235678); } timer.stop(); nanos = timer.nanoTime() / COUNT / SIZE; log.info("fill array; nanos={}", nanos); //
102103104105106107108109110111112
for (final Integer i : array) { // iterate array final Integer x = i; } } timer.stop(); nanos = timer.nanoTime() / COUNT / 1024; log.info("iterate array; nanos={}", nanos); // SET final Set<Integer> set = new HashSet<Integer>();
119120121122123124125126127128129
for (final Integer i : set) { // iterate set final Integer x = i; } } timer.stop(); nanos = timer.nanoTime() / COUNT / 1024; log.info("iterate set; nanos={}", nanos); // timer.start(); for (int k = 0; k < COUNT; k++) {
127128129130131132133134135136137
// timer.start(); for (int k = 0; k < COUNT; k++) { final Object[] x = set.toArray(); } timer.stop(); nanos = timer.nanoTime() / COUNT; log.info("set to array; nanos={}", nanos); }
144145146147148149150151152153154
152153154155156157158159160161162
timer.start(); for (int k = 0; k < COUNT; k++) { BenchBasic.testEmptyCall0(); } timer.stop(); nanos = timer.nanoTime() / COUNT; log.info("empty call; nanos={}", nanos); timer.start(); for (int k = 0; k < COUNT * 10; k++) {
160161162163164165166167168169170
timer.start(); for (int k = 0; k < COUNT * 10; k++) { final int[] array = BenchBasic.testMakeArray0(SIZE); } timer.stop(); nanos = timer.nanoTime() / COUNT / 10; log.info("make arrray 1024; nanos={}", nanos); final int[] arrayInt = new int[SIZE]; timer.start();