Exponential compilation time for List.of(Map.entry) expressions

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Jan 17 11:34:41 UTC 2025


On 17/01/2025 10:57, Tagir Valeev wrote:
> Hello!
>
> On Fri, Jan 17, 2025, 11:13 Maurizio Cimadamore 
> <maurizio.cimadamore at oracle.com> wrote:
>
>
>     Question: is intellij able to figure out the correct types w/o
>     ending up
>     with combinatorial explosion -- or is it using some heuristic to
>     "guess"
>     what the likely type arguments are going to be?
>
>
> This is a performance problem for IntelliJ as well. Highlighting 
> becomes slow on such code. Not sure whether it's slower or faster than 
> javac, but it's definitely slow. So technically, it's 'javac + 
> IntelliJ quirks' :-)

Ah I see - so you do the full analysis, but when it gets "too slow", you 
suggest to use explicit type parameters. Makes sense.

Now, if you have internal diagnostics on when this happens, and see some 
what code triggered it, it might be useful to report bugs -- so that we 
make sure that we avoid all the performance potholes we can avoid.

Cheers
Maurizio

>
>
>     Maurizio
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20250117/66de7b8f/attachment.htm>


More information about the compiler-dev mailing list