RFR: JDK-8292276 : Add named colors from CSS Color Module Level 4 [v38]
Alexey Ivanov
aivanov at openjdk.org
Tue Oct 10 15:07:42 UTC 2023
On Tue, 10 Oct 2023 14:44:04 GMT, Andy Goryachev <angorya at 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
More information about the client-libs-dev
mailing list