[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSLT 2.0 function - fastest node comparison

Subject: RE: XSLT 2.0 function - fastest node comparison
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Thu, 10 Mar 2005 17:17:50 -0000
del 781ms
> > Interestingly, using 'cast as' on $middle to narrow it to
> an integer
> > causes the execution time to increase by 250ms, so I've
> left them all
> > as doubles (the positional predicate in $currentNode doesn't
> > appear to mind
> > using a double).
>
> That makes me realise that it would actually avoid many
> string->number conversions if you extracted the ranges as two
> sequences of integers in global variables:
>
> <xsl:variable name="lows" select="$ranges/*/@from/xs:integer(.)"
> as="xs:integer*"/>
> <xsl:variable name="highs" select="$ranges/*/@to/xs:integer(.)"
> as="xs:integer*"/>
> <xsl:variable name="n" select="count($lows)" as="xs:integer"/>
>
> test="some $i in 1 to $n satisfies ($highs[$i] ge $test and
> $lows[$i] le $test)"


That's much better still:

Old Way 	New Way
932ms		772ms
931ms		771ms
952ms		781ms
941ms		771ms
931ms		781ms

Thanks Mike, always nice to use the 'satisfies' keyword...

cheers
andrew

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.