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.
Thanks.
[1]
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/util/NamespaceSupport.java?annotate=447241
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [email protected]
E-mail: [email protected]
Mukul Gandhi <[email protected]> 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: [email protected]
> For additional commands, e-mail: [email protected]