RFR: 8331744: java.lang.classfile.TypeKind improvements [v4]

Claes Redestad redestad at openjdk.org
Thu May 9 19:20:54 UTC 2024


On Thu, 9 May 2024 12:29:40 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> I actually am not sure of the reason; it is indeed a tableswitch in bytecode. @cl4es might know it better?
>
> Generally I agree with the API changes and with the `descriptor.isPrimitive()` test before requesting a descriptor string.
> However I'm missing the point of the other changes, which only replace this single `tableswitch` with something way more complicated, without clear performance gain.

The code I tested saw a decidedly larger speed-up, perhaps hinging on other optimizations such as being able to avoid the `s.isEmpty()` check (could maybe catch IIOBE) and not matching on `L` and `[` (the lookup table only needs to deal with primitives). As it looks here I agree the speed-up is negligible and not worth it, and since `TypeDescriptor.OfField` isn't a sealed hierarchy perhaps we need some redundant checks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19109#discussion_r1595873311


More information about the core-libs-dev mailing list