On Tue, 10 Oct 2023 14:44:04 GMT, Andy Goryachev <ango...@openjdk.org> wrote:
> would it make more sense to use a switch statement instead of a static map? I believe this was discussed somewhere… Looks like map provides better performance compared to `switch` statement. Fetching an element from a map gives a constant time, using a `switch` statement over strings would give a linear search time unless it's cleverly optimised by the compiler. @scientificware could point you to performance measurements, if there are ones. There were ones, if my memory serves me right. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/9825#discussion_r1352765240