Better way to avoid unused fields being dead-code eliminated
Foivos recently realised that padding fields added to classes get dead-code eliminated in native image.
Performance sensitive code often relies in tricks like that to avoid fail sharing. For native image, one could add register those fields for reflection access, but that's a fairly expensive thing to do in terms of build times, native executable size...etc. It would be nice to have a way to register fields such that they don't get dead-code eliminated.
To paraphrase @zakkak, something akin to query* but opposite.
The thing is: it really matter? false sharing is a problem for high concurrent and high thoughput contended uses cases: sometime is just not worthy and having smaller dataset is better, so...let's think about it where it happens...and I can help to detect the hot spots, see https://github.com/netty/netty/issues/12496 and https://github.com/netty/netty/issues/13945
I believe @franz1981 has provided a useful answer here. In any case, if you still believe this to be relevant, please create a new issue for it.