james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Brewin" <sbre...@synsys.com>
Subject RE: svn commit: r413135 -/james/server/trunk/src/java/org/apache/james/transport/matchers/AbstractNetworkMatcher.java
Date Fri, 09 Jun 2006 21:05:55 GMT
Noel J. Bergman wrote:
> Norman Maurer wrote:
> > > > - Add [protected] set methods for ServiceManager and DNSServer
> > > Those properties were private, and you've now exposed setters
> > i make a mistake
> :-)  No problem.  So this was just a style change, not a
> planned change in
> function?  You prefer to use a private setter rather than an
> assignment, and
> hope that the call overhead gets optimized out by the
> compiler?  Not that it
> matters much in an init() method.  :-)

Most compilers don't optimize this out, but the JVMs do.

To prove the first, decompile your bytecode and see if the methods which
invoke the setter method still do.

To prove the latter, read the many papers on JVM optimizations, or more
pragmattically test it by measuring the releveant performance of each
approach over several iterations.

Optimizing out trivial assertions is one of the most basic tuneups a modern
JVM does. Its true that this may not happen on the first reference and the
optimization will inevitably consume processor time. But its a neglible cost
for good style.

-- Steve

To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message