-
Bug
-
Resolution: Unresolved
-
P3
-
11, 15
ADDITIONAL SYSTEM INFORMATION :
Issue is there for Oracle as well as OpenJDK java11
A DESCRIPTION OF THE PROBLEM :
We are seeing a performance degradation on JDK11 with Class.newInstance() as compared to JDK8.
For quick check I executed below class on both JDK11 and JDK8. Execution time is ~25ms vs ~14ms in JDK11 and JDK8 respectively.
Is this a known issue or any workaround?
public class PerformanceTest {
public PerformanceTest() {
}
public static void main(String[] args) {
long l = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
try {
PerformanceTest.class.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
System.out.println("time taken = " + (System.currentTimeMillis() - l) + "ms");
}
}
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute following class on JDK8 and JDK11 which indicates performance degradation with 11
public class PerformanceTest {
public PerformanceTest() {
}
public static void main(String[] args) {
long l = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
try {
PerformanceTest.class.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
System.out.println("time taken = " + (System.currentTimeMillis() - l) + "ms");
}
}
FREQUENCY : always
Issue is there for Oracle as well as OpenJDK java11
A DESCRIPTION OF THE PROBLEM :
We are seeing a performance degradation on JDK11 with Class.newInstance() as compared to JDK8.
For quick check I executed below class on both JDK11 and JDK8. Execution time is ~25ms vs ~14ms in JDK11 and JDK8 respectively.
Is this a known issue or any workaround?
public class PerformanceTest {
public PerformanceTest() {
}
public static void main(String[] args) {
long l = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
try {
PerformanceTest.class.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
System.out.println("time taken = " + (System.currentTimeMillis() - l) + "ms");
}
}
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute following class on JDK8 and JDK11 which indicates performance degradation with 11
public class PerformanceTest {
public PerformanceTest() {
}
public static void main(String[] args) {
long l = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
try {
PerformanceTest.class.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
System.out.println("time taken = " + (System.currentTimeMillis() - l) + "ms");
}
}
FREQUENCY : always