Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 532776

Summary: Bad Performance of Scope$Substitutor.substitute(Substitution, TypeBinding)
Product: [Eclipse Project] JDT Reporter: Christian Dietrich <christian.dietrich.opensource>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: stephan.herrmann
Version: 4.7.2   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug
Attachments:
Description Flags
Sample Project none

Description Christian Dietrich CLA 2018-03-22 11:17:21 EDT
Created attachment 273255 [details]
Sample Project

Scope$Substitutor.substitute(Substitution, TypeBinding) has bad performance in some of our code. the reason in the inference of generic method parameters

GenericConverter.unwrap(d).doubleValue();

vs

GenericConverter.<Double,SomeConcreteType>unwrap(d).doubleValue();

we have a lot of the first calls in out code and jdt needs 10 minutes on a bigger project

replacing it with

GenericConverter.<Double,SomeConcreteType>unwrap(d).doubleValue();

makes that 10 mins become 300 ms or something like that.

please a small sample project attached
Comment 1 Eclipse Genie CLA 2020-03-26 18:36:25 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Stephan Herrmann CLA 2020-03-26 19:15:16 EDT
Christian, sorry this fell through the cracks. But from your overall observation, we can only see that type inference is more expensive than no type inference ;p
From here to blaming method substitute() is a far shot. Did you have any profiler data to show what call chain might be causing particular pain?

Perhaps, it's not the single execution that causes problems, but the number of calls?