|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XPath "//", speed, and Saxon
Lars,
I will let Mike report any relevant specifics regarding details of Saxon's internal optimizations, but it does sound like what you've discovered is that performance can vary radically depending on the processor used. Even using Xalan, however (if that's what you're using in Cocoon), you might well find that an optimization of the form <xsl:variable name="every-foo" select="//foo"/> and then references to $every-foo instead of literal "//foo" in your code, would work equally or nearly as well as using a key. Depending on the details of what is actually done with these nodes, of course. In general, your observation also demonstrates that what's good practice for one situation may not be good practice for another. Sometimes you know exactly which processor will always be used with your stylesheet; other times you don't. Sometimes your stylesheet will be maintained by others, and needs to be able to adapt over time; other times, it will be a black box. Performance is critical sometimes, but not always. Sometimes the stylesheet is developed to run only once. All of these can affect the determining factors of "good practice". In effect, good practice means striking the right balance for the right situation. Just as Solon told Croesus that no man should be judged happy until after he's dead, similarly, no stylesheet should be judged "good" until after it's retired. Of course, this doesn't mean that your question isn't a concern. If only out of habit, I'd probably not write document-wide traversals like "//foo" except under controlled circumstances -- while also not worrying too much about performance constraints except when I actually face them. I also probably wouldn't write to particular processors' optimizations except when reasonably certain that I could rely on them. Cheers, Wendell At 10:27 AM 10/31/2008, you wrote: Hello, ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








