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

RE: RE: performance with template and choose

Subject: RE: RE: performance with template and choose
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 12 Sep 2002 15:49:40 +0100
RE:  RE: performance with template and choose
> Wow.. Memoisation in XSLT! That's really great.
> 
> Mike, what exactly do you mean by "called twice with the same 
> arguments"?
> 
> For example, if the second time a corresponding argument is a 
> different node having the same string value (or which is 
> "deep equal" to the corresponding previous argument), will 
> this be "the same argument" ?

For atomic values, equal values. For nodes, the same node (by identity).
Now that params have types, I should be able to test the argument after
conversion to the target type, so if the param is type="xs:string", two
different nodes with the same string value would count as the same.
> 
> Is there any reason (besides performance (side-effects)) why 
> memoisation should not be the default behaviour?
> 

I was worried about memory usage: to make it the default, I would have
to implement some kind of discard algorithm. Perhaps using a WeakHashMap
would be OK.

And I was a bit worried about side-effects. (a) Functions can call
extension functions that have side-effects, (b) Functions can create and
return new nodes.

Also I was concerned that for very simple functions, recomputing the
result is likely to be cheaper than managing the hash table.

Perhaps I was just being cautious, and wanted evidence that it worked
well before switching it on by default.

Michael Kay


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


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.