Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 24th, 2010, 07:04 PM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default Performance tips for XSLT 2.0

Hi,

Does anyone know a good pointer out there for best practices when coding using XSLT 2.0 (using Saxon)? I am looking for tips that would improve performance and promote clean design.

Thanks!
 
Old February 24th, 2010, 07:30 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Well, you're asking on a Wrox forum, so it seems reasonable to recommend my book (XSLT 2.0 Prog Ref, 4th edition). It's 1300 pages of advice which may be more than you can digest in one sitting; but your request was pretty broad!
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old February 25th, 2010, 11:23 AM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I do have your book, and it is wonderful. Over the years, I have purchased each edition. What I am looking for are some basic performance saving tips. I remember seeing a list like that out there somewhere, but can't find it now. Tips like:

Instead of using count(), you can grab the last() position of a node set. Which if memory serves, provides a performance savings.

I am just trying to compile a list of common novice mistakes that can cost you when it comes to performance.
 
Old February 25th, 2010, 11:56 AM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found this link which offers some good guidelines:

http://www.dpawson.co.uk/xsl/sect4/N9883.html
 
Old February 25th, 2010, 08:08 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I don't know of any comprehensive list. In fact, you probably don't want a comprehensive list, you want a "top ten mistakes to avoid". Most people would put "//x" in that list, though actually Saxon does quite a good job of optimizing that most of the time - there's a lot of folklore in this and advice written five years ago is not always true today. "Use keys whenever possible" is probably one of the top tips, and one of my pet gripes is to encourage use of <xsl:variable name="x" select="y"/> rather than using a nested xsl:value-of.

But I think the most important tip is to be systematic and methodical about performance engineering: set objectives, create a measurement framework, measure actual against target, investigate where the costs are going, apply the improvements where they will make a difference, measure the impact of changes before committing them. That's nothing to do with XSLT specifically, but that's what makes the difference between code that performs well and code that doesn't. You don't get good performance just by following a cookbook set of coding tips. In fact, if you want one brief tip, it is to focus not on performance improvement, but on performance measurement: once you can measure things well, improving is easy.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old February 26th, 2010, 01:47 PM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Point well taken. I will shift my focus to performance measurement.

Thanks!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance issue in using XSLT Prabeen XSLT 4 July 9th, 2009 10:57 AM
XSLT - XML Transformation Performance fishstix XSLT 5 April 13th, 2009 01:48 PM
hints and tips needed Vano2005 C# 6 July 13th, 2005 11:42 AM
How to make Tool Tips when onmouseover bekim Javascript How-To 5 February 2nd, 2005 08:53 AM
Tool Tips in C# DAK BOOK: Professional C#, 2nd and 3rd Editions 0 January 8th, 2004 12:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.