On Tue, 16 Aug 2022 23:15:38 GMT, SWinxy <[email protected]> wrote: >> ScientificWare has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Removes whitespace. >> >> Remove a whitespace at the end of the file > > That's a bit sus for the enhanced switch statement to be significantly slower > (7.5x more time than the map). Your methodology still shows that you aren't > creating new objects for each invocation and returning the same objects each > time. Is that accurate to your performance table?
Yes @SWinxy, you're right. Map and TreeMap implementations return the same object. Therefore comparisons with the current implemention or switch case solution are not relevant. I going to add a test result with Map + your workaround. Presently, the switch case solution is the best in respect of the current behaviors you want to preserve. I integrated all your comments but yesterday, I was busy with the test case and other propositions that could content you. I take time to found the best solution because there are other places in swing html package where such optimisation would be interresting, especially in view factories. ------------- PR: https://git.openjdk.org/jdk/pull/9825
