Re: [xsl] Is this node, the document root... best test?

Subject: Re: [xsl] Is this node, the document root... best test?
From: Stephen Cunliffe <scunliffe@xxxxxxxxxxxxxxxxxx>
Date: Mon, 20 Oct 2003 12:46:50 -0400
I'm not sure what's holding up my posts (I see responses before I see my post ;-) but,

I thought I'd post my findings on a quick n dirty test...

testing every node in an xml document,...
...start timer 1,
...30 times <xsl:if test=". = /"><!-- just time test --></xsl:if>
...stop timer 1,

...start timer 2,
...30 times <xsl:if test="not(parent::*)"><!-- just time test --></xsl:if>
...stop timer 2,

compare timers...

I found that the first test (timer 1), was routinely 10-30ms faster than the second.
Note:
- my test nodes were between 0-7 levels deep, 500-1,000 nodes in total...
- obvious gc / memory cleanup results were omited
- timer execution times are included, but pressumed minimal, and relatively average.


Cheers,

Steve


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



Current Thread