Slow compilation with a lot of type inference

Vicente Romero vicente.romero at
Thu Jul 22 02:03:14 UTC 2021

Hi Nir,

We have done a lot of work to speed up inference, unfortunately it is 
always possible to generate code that will make the inference engine 
look bad, please file a bug in our JIRA system with all of your findings 
and we will get to it when possible,


On 7/19/21 1:13 PM, Nir Lisker wrote:
> Hi,
> I have recently submitted an Eclipse bug [1] regarding very slow 
> compilation when a lot of type inference is required. The report 
> includes an example case, which looks like:
> public static final Map<String, String> DESC = Map.ofEntries(
>     Map.entry("A", "B"),
>     Map.entry("A", "B"),
>     Map.entry("A", "B"),
>     // many more of these
> );
> The Eclipse developer shows that the slowness happens in javac as 
> well. I understand that every entry needs to be looked at to find the 
> type for Map.ofEntries, and the problem can be resolved by adding 
> Map.<String, String>ofEntries, but I thought it's worth asking here too.
> Is this considered normal behavior?
> [1] 
> <>
> - Nir

More information about the compiler-dev mailing list