RFR: 8319220: Pattern matching switch with a lot of cases is unduly slow

Rémi Forax forax at openjdk.org
Fri Nov 3 16:00:03 UTC 2023


On Fri, 3 Nov 2023 15:29:05 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> Thanks for all the comments so far - I think I've either reflected them, or wrote a comment to each of them. Please let me know if there's something else, or if I've forgotten something.

You idea to use an extra array is clever. Using an immutable List instead of an array should allow the VM to constant fold the Class.isInstance (see above).

-------------

PR Comment: https://git.openjdk.org/jdk/pull/16489#issuecomment-1792698583


More information about the core-libs-dev mailing list