Suboptimal java.lang.record's methods generation
Remi Forax
remi.forax at univ-eiffel.fr
Sun Feb 14 21:41:10 UTC 2021
yes,
the implementation of toString() should use the same metafactory used by the String concatenation.
Here is an example
https://github.com/forax/exotic/blob/master/src/main/java/com.github.forax.exotic/com/github/forax/exotic/ObjectSupports.java#L193
Rémi
----- Mail original -----
> De: "Brian Goetz" <brian.goetz at oracle.com>
> À: "amber-dev" <amber-dev at openjdk.java.net>
> Envoyé: Dimanche 14 Février 2021 20:08:03
> Objet: Fwd: Suboptimal java.lang.record's methods generation
> Received on amber-spec-comments.
>
>
>
> -------- Forwarded Message --------
> Subject: Suboptimal java.lang.record's methods generation
> Date: Sun, 14 Feb 2021 12:13:06 +0000
> From: Rowicki, Michal <Michal.Rowicki at vimn.com>
> To: amber-spec-comments at openjdk.java.net
> <amber-spec-comments at openjdk.java.net>
>
>
>
> Hello!
> I’ve realized that Java 16 generates suboptimal bytecode for
> java.lang.record. In comparison w Lombok there is a huge difference in
> toString() method as current Java’s implementation uses String.format
> method to generate output. All differences can be found at my sample
> repository:
> https://github.com/wyhasany/lombokVsRecord
> I supposed that java.lang.record should have the very same performance
> as Lombok’s @Value:
> https://projectlombok.org/features/Value
> Do you think is it a worth a ticket?
>
> Thanks!
>
> Michał
More information about the amber-dev
mailing list