News for hackers. Stuff that matters.
Re:Java's records, Lombok's data, and Kotlin's data classes by marcinzm on Friday May 07, 2021 @12:53PM (#27078014)
I mean, you do realize that you're writing Java code right? If you want ultimate low level optimization and control then you're already about ten miles too far downstream to make that turn. Also, I'm guessing the copy overhead is more than offset by the JVM being able to do better optimizations around these data structures.
Re:Java's records, Lombok's data, and Kotlin's data classes by iainmerrick on Friday May 07, 2021 @04:20PM (#27080429)
Structs with mutable fields is hardly “ultimate low level optimization”, it’s something a lot of programmers still use as a matter of course. (I say this as a fan of immutable data!)

Ultimate low-level optimization in Java would be more like packing your structure into arrays of integers - which is something people actually do in Java. Just because you’re using Java doesn’t mean you don’t want your code to run as fast as possible.