The Artima Developer Community
Sponsored Link

Re: Optimization Lore



This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Re: Optimization Lore

Posted by Chris Smith on 16 Jun 1998, 6:25 PM

> The optimization lore list addresses the major speed weaknesses
> of current JVMs. However, if your JVM supports a JIT then the
> second point about making classes large to avoid method call
> overhead can actually slow things down. Larger methods mean
> more simultaneously active local variables and this can create
> a situation where not as many locals are assigned to native
> hardware registers. Depending upon the program the extra loading
> and storing of unassigned locals can generate more overhead
> than that the method calls for an alternative method partitioned
> version.

Remember that calling a method means specifically storing and
then loading registers on the stack. You don't save register
swapping by calling methods instead of inlining work. You do, of
course, get code readability, but from a pure performance point
of view, there shouldn't be much difference, or in the worst case
calling methods will be slower.

Chris Smith


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us