xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mukul Gandhi <gandhi.mu...@gmail.com>
Subject Re: inheritable attributes patch, question
Date Mon, 24 Aug 2009 12:26:17 GMT
Hi Michael,
   Thanks, for your reply.

I couldn't get an opportunity to look at NamespaceSupport earlier,
which you pointed. I'll study it in a bit detail, now. It looks to me
conceptually similar to Khaled's suggestion:

<quote>
Instead of using a Map for inheritable attributes with the element
depth being a key, you can use a Vector to store all the inheritable
attributes and then use an IntStack to push/pop the Vector size in
start/endElement. Take a look at XMLSchemaValidator.XSIErrorReporter
for an example.
</quote>

I think, if I implement something like NamespaceSupport, or implement
as Khaled has suggested (quoted above), for inheritable attributes, we
should be able to eliminate many kinds of objects in the
implementation (like, Integer etc.).

I'll keep the list updated, on the progress I am making with this patch.

I'll also appreciate, any other suggestions from anyone, about this,
which I'll definitely look at to make the implementation better.

On Mon, Aug 24, 2009 at 5:26 PM, Michael
Glavassevich<mrglavas@ca.ibm.com> wrote:
> 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: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org



-- 
Regards,
Mukul Gandhi

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


Mime
View raw message