-
Bug
-
Resolution: Fixed
-
P4
-
None
20 lines source takes an HOUR to compile:
class C<U> {
U fu;
C() {}
C(C<U> other) { this.fu = other.fu; }
C(U fu) { this.fu = fu; }
static <U> C<U> m(C<U> src) { return new C<U>(src); }
public static void main(String argv[]) {
/* type inference is expected here: */
C<String> c2 = m(new C<>(m(new C<>() )) );
C<String> c3 = m(new C<>(m(new C<>(m(new C<>() )) )) );
C<String> c4 = m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) ); // Javac(1.04), ECJ(.71s)
C<String> c5 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) ); // Javac(2.02s), ECJ(1.17s)
C<String> c6 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) ); // Javac(4.84s) ECJ(1.67s)
C<String> c7 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) )) ); // Javac(14.99s) ECJ(10.82s)
C<String> c8 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) )) )) ); // Javac(79.62s) ECJ(134.64s)
C<String> c9 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) )) )) )) ); // Javac(437s) ECJ(1305s)
C<String> c10 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))))))))))); // 3600
}
}
Each lines show how long it takes to compile it in seconds.
Time is about the same for original jdk8.0 and latest jdk8u20 and jdk9.
class C<U> {
U fu;
C() {}
C(C<U> other) { this.fu = other.fu; }
C(U fu) { this.fu = fu; }
static <U> C<U> m(C<U> src) { return new C<U>(src); }
public static void main(String argv[]) {
/* type inference is expected here: */
C<String> c2 = m(new C<>(m(new C<>() )) );
C<String> c3 = m(new C<>(m(new C<>(m(new C<>() )) )) );
C<String> c4 = m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) ); // Javac(1.04), ECJ(.71s)
C<String> c5 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) ); // Javac(2.02s), ECJ(1.17s)
C<String> c6 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) ); // Javac(4.84s) ECJ(1.67s)
C<String> c7 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) )) ); // Javac(14.99s) ECJ(10.82s)
C<String> c8 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) )) )) ); // Javac(79.62s) ECJ(134.64s)
C<String> c9 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>() )) )) )) )) )) )) )) )) ); // Javac(437s) ECJ(1305s)
C<String> c10 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))))))))))); // 3600
}
}
Each lines show how long it takes to compile it in seconds.
Time is about the same for original jdk8.0 and latest jdk8u20 and jdk9.
- is blocked by
-
JDK-8051946 JEP 215: Tiered Attribution for javac
- Closed
-
JDK-8032360 javac, speculative attribution refactoring
- Closed
- relates to
-
JDK-8225508 Compiler OOM Error with Type Inference Hierarchy
- Open
-
JDK-8048838 type inference performance regression
- Closed
-
JDK-8078093 Severe compiler performance regression Java 7 to 8 for nested method invocations
- Closed