On Mon, 8 Mar 2021 12:10:24 GMT, Claes Redestad <redes...@openjdk.org> wrote:

>> I only looked at it because of the updates to use switch expressions...
>> ok, either way.
>
> I had reason to muck around with the switch expressions, since 
> `Conversion.isValid` was inefficient (for startup) and subtly wrong (accepted 
> `'t'`).
> 
> Getting rid of explicit unboxing - `.byteValue()` - is just a syntactic 
> improvement, so I indulged in a few places.
> 
> Using instanceof pattern matching OTOH changes bytecode shape a fair bit by 
> introducing locals and changing the execution order. The suggestions you made 
> above also mean we'd unbox twice. Probably inconsequential, but I'm wary of 
> such changes when I don't have benchmarks to assert they are performance 
> neutral.

Makes sense, good to know... slick language features *may* come at a cost.

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

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

Reply via email to