xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mk...@ca.ibm.com
Subject Re: cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/dom DOMAdapter.java SAXImpl.java
Date Fri, 07 Mar 2003 21:22:44 GMT
I also think that avoiding the use of final at all is not something
practical. In some cases marking a method as final improves the performance
by a sigficiant amount. Many of the Java books and reference materials
actually encourage the usage of final for performance reasons.  Of course I
would agree that we should use it carefully, in order not to limit the
extensibility. There are already many final methods in Xalan source code. I
do not think there is a reason not to introduce any new final method at
all.

Morris Kwan
XSLT Development
IBM Toronto Lab
Tel: (905)413-3729
Email: mkwan@ca.ibm.com



                                                                                         
                                               
                      "Santiago                                                          
                                               
                      Pericas-Geertsen"              To:       <xalan-dev@xml.apache.org>
                                               
                      <Santiago.PericasGeerts        cc:       <xml-xalan-cvs@apache.org>
                                               
                      en@sun.com>                    Subject:  Re: cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/dom
            
                                                      DOMAdapter.java SAXImpl.java       
                                               
                      03/07/2003 03:58 PM                                                
                                               
                      Please respond to                                                  
                                               
                      xalan-dev                                                          
                                               
                                                                                         
                                               
                                                                                         
                                               



----- Original Message -----
From: "Joseph Kesselman" <keshlam@us.ibm.com>


> Note that final methods also cause problems if/when you need to introduce
> subclassing/polymorphism, and that SUN's own performance team generally
> recommends strongly *AGAINST* trying to use the final keyword as an
> optimization trick.

 Sun's Hotspots has a mechanism by which it essentially infers the final
keyword (often, e.g. if a certain class loaded, it can also "uninfer" it).
The main advantage of a final method is that it can be inlined, thus saving
the overhead of method invocation and late binding. I can't think of any
reason for which not to use final: for variables it promotes constant
propagation (typically at compile time and when the init expression has not
side effects), for methods it promotes inlining.

 This is just my opinion though, I can always contact the performance team
if we want to make sure. Do you have a reference Joe?

-- Santiago



---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message