RFR: 8286270: [java.desktop] Replace color search in XColors with a switch statement

Julian Waters jwaters at openjdk.java.net
Fri May 6 03:50:29 UTC 2022


On Thu, 7 Apr 2022 15:27:11 GMT, SWinxy <duke at openjdk.java.net> wrote:

>> The current implementation creates ~750 new objects on load, and uses a binary array search with a Comparable implementation. This implementation is probably bad. Instead, we can use the enhanced switch feature to possibly save time, resources, and code size. The new implementation means that the array doesn't have to be sorted alphanumerically necessarily, and it creates the colors on demand.
>
> Keeping open.

Hey there @SWinxy, same thing with this PR, this time rename the title to just 8286270

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

PR: https://git.openjdk.java.net/jdk/pull/7096



More information about the client-libs-dev mailing list