Performance dropped significantly when switching from Nested Patterns to Flattened Patterns (was "Sharing my experience with Switch Expressions")

David Alayachew davidalayachew at gmail.com
Mon Jun 16 00:43:09 UTC 2025


Thanks for the response folks. I'll try and get this done as soon as I can.

On Thu, Jun 12, 2025 at 4:11 PM Angelos Bimpoudis <
angelos.bimpoudis at oracle.com> wrote:

> Hello David,
>
> Many thanks for the experience/bug report.
>
> It would help us tremendously if you could provide a single,
> self-contained and concise test file, demonstrating this behaviour.
>
> A simple .java file that can be compiled via javac speeds up the process,
> but it is also an interesting exercise for the bug reporter.
>
> (this is actually how most bug reports are stored in our test suite,
> minimized and self-contained so that jtreg can invoke them:
> https://github.com/openjdk/jdk/tree/master/test/langtools/tools/javac;
> for you, no need to use jtreg, something that compiles with just javac is
> fine)
>
> Looking forward for the test minimization.
>
> Angelos
>
>
> ------------------------------
> *From:* amber-dev <amber-dev-retn at openjdk.org> on behalf of David
> Alayachew <davidalayachew at gmail.com>
> *Sent:* 12 June 2025 21:55
> *To:* Chen Liang <chen.l.liang at oracle.com>
> *Cc:* amber-dev <amber-dev at openjdk.org>
> *Subject:* Performance dropped significantly when switching from Nested
> Patterns to Flattened Patterns (was "Sharing my experience with Switch
> Expressions")
>
> Woah, something new came up.
>
> On a whim, I tried to run the performance numbers, to see if there were
> any performance differences between the nested pattern style and the
> flattened pattern style, and there was!
>
> The nested pattern style finished in under 30-60 seconds. But the
> flattened pattern style took OVER AN HOUR.
>
> I just wanted to bring this up, in case this is a bug, or maybe it's
> expected behaviour. Please let me know!
>
> On Fri, May 23, 2025 at 7:10 AM David Alayachew <davidalayachew at gmail.com>
> wrote:
>
> Please let me know if there are any details missing, or if I could better
> explain the situation.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20250615/31419c2c/attachment.htm>


More information about the amber-dev mailing list