Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obsolete Java Optimization Tips

There are number of performance tips made obsolete by Java compiler and especially Profile-guided optimization. For example, these platform-provided optimizations can drastically (according to sources) reduces the cost of virtual function calls. VM is also capable of method inlining, loop unrolling etc.

What are other performance optimization techniques you came around still being applied but are actually made obsolete by optimization mechanisms found in more modern JVMs?

like image 625
Dan Avatar asked Oct 25 '10 21:10

Dan


People also ask

Does Java have Optimization?

The JVMs JIT compiler is one of the fascinating mechanisms on the Java platform. It optimizes your code for performance, without giving away its readability. Not only that, beyond the “static” optimization methods of inlining, it also makes decisions based on the way that the code performs in practice.

What is code optimization give example for any two optimization techniques?

Code Optimization Techniques. Rearranges the program code to minimize branching logic and to combine physically separate blocks of code. If variables used in a computation within a loop are not altered within the loop, the calculation can be performed outside of the loop and the results used within the loop.


1 Answers

The final modifier on methods and method parameters doesn't help with the performance at all.

Also, the Java HotSpot wiki gives a good overview of the optimizations used by HotSpot and how to efficiently use them in Java code.

like image 184
Eugene Kuleshov Avatar answered Oct 01 '22 00:10

Eugene Kuleshov