←back to thread

207 points mfiguiere | 2 comments | | HN request time: 0.448s | source
1. ars ◴[] No.43540675[source]
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.

replies(1): >>43544753 #
2. pron ◴[] No.43544753[source]
No, 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.