3 ms·
Does this mean I should start marking my variables (and function parameters) with Final? Up till now I always assumed the compiler would figure out on its own
by ars 2y ago
Does this mean I should start marking my variables (and function parameters) with Final?
Up till now I always assumed the compiler would figure out on its own which variables were final, and optimize as needed. But this JEP makes it seem like there are optimizations that only happen if you manually mark the variable.
- pron 2y agoNo, this JEP only talks about fields; it has no impact whatsoever on locals. There's no positive or negative impact on performance when making locals final or not.