Joseph,
Just small addition - on why indexing is not in use -
I'm looking into DTMDefaultBaseTraversers class - seems like the only class
in xalan , which implements using indexes created in DTMDefaultBase.
There are two methods first() in in DTMDefaultBaseTraversers.ChildTraverser
class
public int first(int context)
{
return getFirstChild(context);
}
and
public int first(int context, int expandedTypeID)
{
if(true)
{
int identity = makeNodeIdentity(context);
int firstMatch = getNextIndexed(identity, _firstch(identity),
expandedTypeID);
return makeNodeHandle(firstMatch);
}
else
{
// %REVIEW% Dead code. Eliminate?
for (int current = _firstch(makeNodeIdentity(context));
DTM.NULL != current;
current = _nextsib(current))
{
if (m_exptype.elementAt(current) == expandedTypeID)
return makeNodeHandle(current);
}
return NULL;
}
}
First is method is capable of using index, second is not capable. The
problem the method first(int) is called everywhere, not the second one. Not
sure where it shoudl be used...
Best regards,
Pavel
> -----Original Message-----
> From: Joseph Kesselman [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 17, 2002 5:57 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Why do indexing?
>
>
> Indexing yields a performance improvement in some
> stylesheets, by reducing
> the amount of tree-walking needed to find elements by name.
> But it does
> have some computational/storage cost, and some stylesheets
> won't benefit
> from it. As with any optimization, we're playing the odds...
>
> Internally, indexing can be turned on or off when the DTM is
> requested
> from the DTMManager -- we don't attempt to index RTFs, for
> example, since
> they're usually small enough (and transient enough) that the cost of
> indexing would outweigh the gain. But I don't think we've
> exposed any way
> to control that via the user APIs; it appears to be hardcoded in the
> Transformer.transform() call.
>
> If you want to experiment with it and see whether exposing
> this control
> would be useful, the patch point is in the
> Transformer.transform() method,
> where it calls
> DTM dtm = mgr.getDTM(source, false, this, true, true);
> Changing that to
> DTM dtm = mgr.getDTM(source, false, this, true, false);
> would turn off indexing.
>
> If that does turn out to be significantly helpful for a
> significant number
> of stylesheets, we should probably post an Enhancement request in
> Bugzilla suggesting that a feature be created to control this.
>
> ______________________________________
> Joe Kesselman / IBM Research
>