[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-compiler-dev
Subject:    Re: Type inference exponential compilation performance
From:       ella nekipelova <ella.nekipelova () oracle ! com>
Date:       2014-09-26 15:13:29
Message-ID: 54258299.6070109 () oracle ! com
[Download RAW message or body]

Hi Vicente,
Thank you very much for the prompt reply. I'd like also to know if there 
exist any OpenJDK Jira issue to track the progress on this bug?

Thank you,
Ella

On 25.09.2014 22:02, Vicente-Arturo Romero-Zaldivar wrote:
> Hi Ella,
>
> Thanks for your mail. We are aware of the issue and we are actively 
> working on it.
>
> Thanks,
> Vicente
>
> On 09/25/2014 07:56 AM, ella nekipelova wrote:
>> Hello, dear team,
>>
>> I have a question concerning the javac performance in resolving type 
>> inference. I found that if there are more than three nested 
>> invocations with type inference, compilation might take several minutes.
>> Consider this example:
>>
>> class Test<T> {
>>
>>     Test obj;
>>
>>     Test(Test<T> other) { this.obj = other.obj; }
>>
>>     static <U> Test<U> m(Test<U> src) { return new Test<U>(src); }
>>
>>     public static void main(String argv[]) {
>>
>>         Test<String> c14 = m(new Test<>(m(new Test<>(m(new 
>> Test<>(m(new Test<>(m(new Test<>(m(new Test<>(m(new Test<>(m(new 
>> Test<>(m(new Test<>(m(new Test<>(m(new Test<>(m(new Test<>(m(new 
>> Test<>(m(new Test<>())))))))))))))))))))))))))));
>>
>>     }
>>
>> }
>>
>>  I noticed that there is exponential growth, because for for 8 
>> invocations it takes 20 sec, for 9 - 50 sec, for 10 invocations 
>> compilation succeeds in about 3 minutes, but for 14 invocations, as 
>> in the example, javac just hangs.
>>
>> It's unlikely that any human developer will ever write such code, but 
>> there are different kinds of code generators, and we can't be sure 
>> about their implementation.
>>
>> My question is if this behavior is admissible? Are you going to do 
>> anything to improve this situation?
>>
>> Thank you,
>> Ella
>>
>>
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic