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

Re: Exslt implementation, was "When does sort occur?"

Subject: Re: Exslt implementation, was "When does sort occur?"
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 13 Jun 2003 19:06:16 +0200
when does implementation occur
> You could also of course just write a template directly that iterates
> along a parameter containing the node set, and passing on a parameter
> with the largest value so far.
> Any of these solutions is likely to just have to make one pass over the
> data to fond the largest so will have time proportional to the n if
> there are n nodes to be accessed.
> using xsl:sort and taking the first  requires less keystrokes to code in
> xslt but will always take longer given a large enough data set (unless
> you have a very smart query optimiser) as you first sort all the nodes
> into a complete order and then ignore most of that information and just
> take the first. You can not sort a list of values in order n time, most
> likely it takes n log n.

This is so.

Interestingly, I have not been able to construct an example (regardles of
the length of the node-set) when the xsl:sort - based algorithm is actually
slower than the linear solutions.

O(N) and O(log(N) * N)  both have a some coefficient at the front -- 
obviously the one for the liner solutions is quite big.


Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

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

Current Thread


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.
First Name
Last Name
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.