xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Glavassevich <mrgla...@ca.ibm.com>
Subject Re: inheritable attributes patch, question
Date Mon, 24 Aug 2009 11:56:02 GMT

Hi Mukul,

I glanced briefly at your patch and looks like what you're doing is
functionally equivalent to managing a namespace context. Have you looked at
NamespaceSupport [1] before? You should be able to do something similar for
the inheritable attributes which would greatly reduce the number of objects
being created (i.e. could completely eliminate the Integer, ArrayList and
Iterator objects). Something like:

public class InheritedAttributeContext {

   private InheritableAttribute[] fInheritedAttrs = ...;
   private int fInheritedAttrSize;
   private int[] fContext = new int[8];
   private int fCurrentContext;

   // methods similar to NamespaceSupport

In that you could also reuse the InheritableAttribute objects. All of this
would help improve performance.



Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Mukul Gandhi <gandhi.mukul@gmail.com> wrote on 08/24/2009 05:57:18 AM:

> Hi all,
>    I am working upon improvements, for inheritable attributes patch,
> as suggested by Khaled Noaman.
> I have completed all functional improvements, as suggested by Khaled.
> I hope to submit the updated patch, asap.
> I have a question, on one of the suggestions, which Khaled sent:
> Khaled wrote, that don't use new Integer(.. rather, we should use
> Integer.valueOf(..
> I agree to this. But JRE 1.3 and 1.4 do not have a
> Integer.valueOf(int) API. JRE 1.4 has an API, Integer.valueOf(String).
> So it seems, to meet this requirement, we need to write as,
> Integer.valueOf(""+fElementDepth).
> Is Integer.valueOf(""+fElementDepth) better, or new Integer(.. is better?
> Through, JRE 1.5 and above has an API, Integer.valueOf(int). But we
> can't use, this API as we need to conform to JRE 1.3.
> --
> Regards,
> Mukul Gandhi
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-dev-help@xerces.apache.org
View raw message