RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo [v2]

liach duke at openjdk.java.net
Wed May 25 05:12:40 UTC 2022


On Fri, 20 May 2022 22:18:42 GMT, liach <duke at openjdk.java.net> wrote:

>> Simplify opcode handling, use `final` in `PrimitiveTypeInfo`, and replace the hash map with a simple lookup, similar to what's done in [JDK-8284880](https://bugs.openjdk.java.net/browse/JDK-8284880) (#8242)
>
> liach has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Convert PrimitiveTypeInfo to an enum

I would prefer to look up in a `Map.ofEntries` than to switch on string class names, which is both faster and clearer. The even faster heuristic of using perfect hash table has already been proven slower than the list of if statements in JDK-8284880, referred to in the pull request description.

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

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


More information about the core-libs-dev mailing list