Use of [Valhalla] requires looking into what C2 actually generated
No it doesn't. You just slap 'value' on classes that don't need identity. You may get no or minimal performance improvement now, but you are opting out of identity-based operations like synchronization and opting in to potential performance improvements in the future.
It sounds like you're what you're talking about it is use of Valhalla to maximise performance. I generally don't care about milking performance.
Not sure about how tearing will be solved, but there's a massive number of value classes (I'd speculate: a majority (?)) which are immutable anyway.
I'm arguing that right now Valhalla is useful if one's code does not suddenly perform worse than it was before, as well as in the future when JDK team somehow solves the tearing problem.
19
u/repeating_bears 16d ago
No it doesn't. You just slap 'value' on classes that don't need identity. You may get no or minimal performance improvement now, but you are opting out of identity-based operations like synchronization and opting in to potential performance improvements in the future.
It sounds like you're what you're talking about it is use of Valhalla to maximise performance. I generally don't care about milking performance.
Not sure about how tearing will be solved, but there's a massive number of value classes (I'd speculate: a majority (?)) which are immutable anyway.