Re: [xsl] xpath // query

Subject: Re: [xsl] xpath // query
From: Peter Davis <pdavis152@xxxxxxxxx>
Date: Wed, 24 Apr 2002 05:51:09 -0700
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 24 April 2002 05:26, Aleksander Dye wrote:
> select="A//C"
> select="A//B//C"
>
> when I know that <B> is *guranteed* to be there (both select the same
> nodes).  By adding the test for <B>, will it make the selection any faster?

Now, take whatever I say with a grain of salt because I haven't actually 
implemented a processor or tested this.  But it seems like the first might 
actually be faster, because when using the second expression, each node under 
<B> would probably be tested to see if it is a <B> *or* a <C>, while in the 
first expression only the test for <C> must be made.  This may or may not be 
the case, depending on how smart/dumb your processor is.

On the other hand, if you were able to limit the '//' such as A/*/*/B//C, then 
it would certainly be faster, but it sounds like this is not possible.

Remember that the only way to really find out for your given processor (and I 
am sure it varies between processors) is to profile the actual runtimes.

- -- 
Peter Davis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8xqpBNSZCJx7tYycRAnPzAJ4xvg5UaDM4FzEWL0aIqHYa4UuRawCfTqA9
I1UlHQ34t2plQqDa2len5gE=
=Ihtc
-----END PGP SIGNATURE-----


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread