4 ms·
I think that the proposed solutions, @Contended and perhaps some sort of @Respect-My-Variable-Order, is adding more knowledge overhead than a simple rule, the J
by fmstephe 13y ago
I think that the proposed solutions, @Contended and perhaps some sort of @Respect-My-Variable-Order, is adding more knowledge overhead than a simple rule, the JVM will lay out your variables in the order you declare them and it won't drop any even if it knows you aren't using them.
This feels like the simplest option to implement on both sides, the JVMs do less work and the programmers have simple rules to do in-object memory layout if we like that sort of thing. More than anything else it means we don't have to wait on a new JSR for each type of memory layout we want to achieve.
(I suppose there might be some CPU arch portability that the JVM might be able to do if we go with the annotations - but I think that we may be chasing a fools dream down that road)