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

Re: Fwd: Re: suggestions for per request xslt perfor

Subject: Re: Fwd: Re: suggestions for per request xslt performance?
From: Nic James Ferrier <nferrier@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 26 Apr 2007 11:10:10 +0100
Re: Fwd: Re:  suggestions for per request xslt   perfor
Andrew Mason <andrew@xxxxxxxxxxxxxxx> writes:

>> 3. if you have any kind of persistent store with PHP you can cache the
>> stylesheet. 
> It's not the stylesheet that is the issue, it's the time taken to load the 
> stylesheet into the xslt processor.  Creating the DOMDocument from the 
> stylesheet is quick. Processing the stylesheet is fast. The importStylesheet 
> function is probably comparitively fast too, however it's still too expensive 
> on a /request basis.
>
> One of the other people on the list suggested memcached which might be an 
> option for caching the processor. 

That's what I was getting at. You need the libxslt transformContext
support tho as I recall...

My python transform wrapper looks like this:

        try:
            stylesheet = libxslt.newStylesheet()
            stylesheet = stylesheet.parseStylesheetProcess(stylesheet_dom)
        except Exception, e:
            logger.error("failed to parse xslt: " + str(e))
            raise ProcessException(e)
        else:
            try:
                transform_context = stylesheet.newTransformContext(src_dom)
                result_dom = stylesheet.applyStylesheetUser(src_dom, {}, transform_context)
            except Exception, e:
                logger.error("failed to run XSLT")
                raise ProcessException(e)

I can cache the stylesheet_dom (which is what I do rather than caching
the processor).

You say "importStylesheet" I'm not sure what that means.

Have you tried breaking the stylesheet creation down into:

1.  create stylesheet source dom
2.  create processor from that dom?

You normally do that with:

    parseStylesheetDoc(doc)

but you can also do it as I've done the above.

-- 
Nic Ferrier
http://www.tapsellferrier.co.uk   

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-2011 All Rights Reserved.