A DESCRIPTION OF THE PROBLEM :
I've compared performance of methods generated by Lombok's `@Value` annotation with methods generated for java.lang.record. There is a huge difference in toString method as a record create it with help of String.format method. I think it should be created with help of simple concatenation. More over it seems that hashCode() for some reason is also slower that the Lombok's one. Here is the public repository with JMH benchmarks and with flamegraphs showing the difference in implementation.
https://github.com/wyhasany/lombokVsRecord
I've compared performance of methods generated by Lombok's `@Value` annotation with methods generated for java.lang.record. There is a huge difference in toString method as a record create it with help of String.format method. I think it should be created with help of simple concatenation. More over it seems that hashCode() for some reason is also slower that the Lombok's one. Here is the public repository with JMH benchmarks and with flamegraphs showing the difference in implementation.
https://github.com/wyhasany/lombokVsRecord
- duplicates
-
JDK-8261847 performance of java.lang.Record::toString should be improved
-
- Resolved
-
- relates to
-
JDK-8261847 performance of java.lang.Record::toString should be improved
-
- Resolved
-