Java Holiday Calendar 2016 (Day 15): Don't Optimize Now! - DZone Java
The JVM is also using a scheme called Code Flattening , which means that it is able to "roll up" method calls and consider the code as a larger flow of operations. This way, it is able to determine the possible paths the program can take and consider these paths individually and optimize them. For example, identical range checking that takes place in several methods that call each other can be eliminated. Another example is that dead paths (e.g. where an "if"-branch is using a constant expression) can be eliminated altogether.
Another means of optimization is Escape Analysis, which is used to determine if an object is visible outside a certain scope. If not, the object can be allocated on the stack rather than on the heap, making the program run much faster.
Read full article from Java Holiday Calendar 2016 (Day 15): Don't Optimize Now! - DZone Java
No comments:
Post a Comment