[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Code analyze

adrian@jboss.org do-not-reply at jboss.com
Mon Oct 2 07:22:54 EDT 2006


Certainly, in most cases, if the JIT can't optimize to a cpu register,
it will reintroduce the temporary anyway.
That is true even if you don't use a temporary in your code.

The optimization to a register (rather than a stack entry)
will be done regardless of whether the temporary is explicitly declared.

However, with most modern cpus it makes no real difference
since the memory (for smallish methods) will be cached on the cpu.
Making it nearly as fast as registers anyway.

I'd imagine that hotspot removes unncessary cases if it is JIT compiled?
If it is not JIT compiled then it doesn't need optimization.

But the unncessary cast does make the code harder to read.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975462#3975462

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975462



More information about the jboss-dev-forums mailing list