manual alorithm (#2096)

* moving jmh into libraries module

* refactoring jmh

* Update pom.xml

* manual algorightm

* with BM result

* fix for space issue

* Fixed indentation
This commit is contained in:
Abhinab Kanrar 2017-06-20 12:32:26 +05:30 committed by Zeger Hendrikse
parent 547b5850fb
commit 53227eaf0e
4 changed files with 46 additions and 3 deletions

View File

@ -6,9 +6,7 @@ import org.openjdk.jmh.Main;
import org.openjdk.jmh.runner.RunnerException;
public class JmhDemo {
public static void main(String[] args) throws RunnerException, IOException {
Main.main(args);
Main.main(args);
}
}

View File

@ -0,0 +1,19 @@
package com.baeldung.jmh.warmup;
public class MainApplication {
static long start;
static long end;
static {
ManualClassLoader.load();
}
public static void main(String[] args) {
start = System.nanoTime();
ManualClassLoader.load();
end = System.nanoTime();
System.out.println("Total time taken : " + (end - start));
}
}

View File

@ -0,0 +1,17 @@
package com.baeldung.jmh.warmup;
import com.baeldung.jmh.warmup.dummy.Dummy;
public class ManualClassLoader {
public static void load() {
for (int i = 0; i < 100000; i++) {
// load all(or most) important classes
Dummy dummy = new Dummy();
dummy.m();
}
}
}

View File

@ -0,0 +1,9 @@
package com.baeldung.jmh.warmup.dummy;
public class Dummy {
public void m() {
}
}