Does java do runtime optimization?
I am observing this weird behaviour while profiling a java application.
It seems like java actually inlines methods while running.
For example, consider
int foo() {
int x;
x = bar(x);
return x;
}
if foo is called 100 times, it calls bar() the first few times (28 times ) but soon stops calling bar().
When I have a System.out inside bar(), it is called 100 times.. Without it, I see it being called 28 times and then it doesn't.
Any comments?

