I have a small method which is called many many times, I want make this method call efficient, how can I do it?
There is something called inline method in C++ which actually does execution of small methods fast.
Thanks,
HH
There is no concept of inline functions in java. Better say , it is implicit. The JVM automatically inlines the frequently used appropriate methods which it assumes would save time
You're not writing C++ but Java. It is completely different. There is a JVM which monitors the performance of your code, and can effectively optimise the code as it runs. It can alter the code; if there are frequent method calls which are acting as a drag on the system, then the JVM can alter the code with the calls inlined, if it "thinks" that will improve performance. That is what is called "just-in-time" compilation. It is usually counter-productive to try telling the JVM how to execute the code; it does it far better if left to itself than if the programmer tries to micro-manage code with keywords like "register" or "inline."