Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 10246 invoked from network); 22 Oct 2008 13:52:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Oct 2008 13:52:08 -0000 Received: (qmail 95627 invoked by uid 500); 22 Oct 2008 13:52:09 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 95548 invoked by uid 500); 22 Oct 2008 13:52:08 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 95486 invoked by uid 99); 22 Oct 2008 13:52:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Oct 2008 06:52:08 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Oct 2008 13:51:05 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 31C2D234C22A for ; Wed, 22 Oct 2008 06:51:44 -0700 (PDT) Message-ID: <1698433949.1224683504188.JavaMail.jira@brutus> Date: Wed, 22 Oct 2008 06:51:44 -0700 (PDT) From: "Sylvain Wallez (JIRA)" To: dev@cocoon.apache.org Subject: [jira] Commented: (COCOON3-6) The org.apache.cocoon.pipeline.component.sax.XSLTTransformer can be optimized In-Reply-To: <238676283.1224682245564.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COCOON3-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641831#action_12641831 ] Sylvain Wallez commented on COCOON3-6: -------------------------------------- This feature has been available in Cocoon for ages, storing Template objects in a LRU cache, and reloading stylesheets as needed when they have changed. Writing a new Cocoon is fine, but it should learn from the old one and reuse some of it. > The org.apache.cocoon.pipeline.component.sax.XSLTTransformer can be optimized > ----------------------------------------------------------------------------- > > Key: COCOON3-6 > URL: https://issues.apache.org/jira/browse/COCOON3-6 > Project: Cocoon 3 > Issue Type: New Feature > Components: cocoon-pipeline > Affects Versions: 3.0.0-alpha-2 > Reporter: Simone Tripodi > Assignee: Cocoon Developers Team > Priority: Minor > Fix For: 3.0.0-alpha-2 > > Attachments: XSLTTransformerOptimization.patch > > > Every time the XSLTTransformer#setXMLConsumer method is called, the XSLT is parsed reading the URL source and used to create the javax.xml.transform.sax.TransformerHandler: to be more clear > [...] > XSLTTransformer xsltTransformer = new > XSLTTransformer(getClass().getResource("myXSLT.xsl")); > Pipeline pipeline1 = new NonCachingPipeline(); > pipeline1.addComponent(new StringGenerator("")); > pipeline1.addComponent(xsltTransformer); > pipeline1.addComponent(new XMLSerializer()); > pipeline1.setup(System.out); > pipeline1.execute(); > Pipeline pipeline2 = new NonCachingPipeline(); > pipeline2.addComponent(new StringGenerator("")); > pipeline2.addComponent(xsltTransformer); <========================== the URL pointed by getClass().getResource("myXSLT.xsl") will be parsed again!!! > pipeline2.addComponent(new XMLSerializer()); > pipeline2.setup(System.out); > pipeline2.execute(); > As a quick solution we can store the Template to build the transformer handler objects in a static hashmap, but in the future we should introduce stores. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.