Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 85598 invoked from network); 27 Apr 2008 03:56:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Apr 2008 03:56:32 -0000 Received: (qmail 99183 invoked by uid 500); 27 Apr 2008 03:56:23 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 99147 invoked by uid 500); 27 Apr 2008 03:56:23 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 99136 invoked by uid 99); 27 Apr 2008 03:56:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Apr 2008 20:56:23 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [220.233.0.38] (HELO panama.exetel.com.au) (220.233.0.38) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Apr 2008 03:55:37 +0000 Received: from ns1.exetel.com.au ([220.233.0.1] helo=ef.exetel.com.au) by panama.exetel.com.au with smtp (Exim 4.68) (envelope-from ) id 1JpxzR-0000eB-4X for user@struts.apache.org; Sun, 27 Apr 2008 13:55:49 +1000 Received: (qmail 27112 invoked by uid 508); 27 Apr 2008 03:55:48 -0000 Received: from blueskyminds.com.au (HELO ?192.168.1.151?) (jeromy.evans@blueskyminds.com.au@220.233.11.162) by ef.exetel.com.au with SMTP; 27 Apr 2008 03:55:48 -0000 Message-ID: <4813F8C2.2030709@blueskyminds.com.au> Date: Sun, 27 Apr 2008 13:53:38 +1000 From: Jeromy Evans Organization: Blue Sky Minds Pty Ltd User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Struts Users Mailing List Subject: Re: Struts 2 - Where does all the CPU go References: <30E6B5904E5C814BA7EF81A95FFCD1EA0115D8F339E2@PTVEXCCL01.ptv.com> In-Reply-To: <30E6B5904E5C814BA7EF81A95FFCD1EA0115D8F339E2@PTVEXCCL01.ptv.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Matthew Seaborn wrote: > > In an attempt to find out where all the CPU cycles go I ran JProfiler > against a request for a Struts 2 page containing a form with around 40 > tags running under Tomcat 5.5, using SiteMesh for styling. > > > > The details are below, but FreeMarker seems to be the primary guilty > party. Does anyone know how to get it to go faster, I already have > the freemarker.properties file in WEB-INF/classes. > > > > For those that are interested, the details. > > > > > > Around 7% went to Tomcat and 4% to SiteMesh. > > > Hi Matthew, I'm surprised that you can contribute more to FreeMarker than to than Ognl. Perhaps FreeMarker is still masking the underlying problem as the templates predominately call into the model setup by Struts and most of that model is prepared via OGNL expressions. OGNL does cache expressions though and you would be reusing many of them. Turn on freemarker template caching. This is a cache within struts2, rather than FreeMarker's own cache, that reuses the Template object keyed by name rather than going to the template loader. in struts.properties: struts.freemarker.templatesCache=true 1.5 seconds within the template rendering is still huge though, even with freemarker caching turned off. One of the templates must be calling *something* slow in the struts 2 model. I've always suspected that the guys below were eating up my cycles. 2008-04-27 13:26:58,413 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [org.apache.tiles.AttributeContext.STACK] 2008-04-27 13:26:58,414 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [org.apache.tiles.AttributeContext.STACK] 2008-04-27 13:26:58,414 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [org.apache.catalina.jsp_file] 2008-04-27 13:26:58,851 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [templateDir] 2008-04-27 13:26:58,852 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [templateDir] 2008-04-27 13:26:58,852 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [theme] 2008-04-27 13:26:58,853 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [theme] 2008-04-27 13:26:58,854 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [templateDir] 2008-04-27 13:26:58,854 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [templateDir] 2008-04-27 13:26:58,869 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [theme] 2008-04-27 13:26:58,870 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [theme] 2008-04-27 13:26:58,878 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [.freemarker.Request] 2008-04-27 13:26:58,878 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [.freemarker.RequestParameters] 2008-04-27 13:26:58,880 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [commands] 2008-04-27 13:26:59,036 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [property] 2008-04-27 13:26:59,044 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [property] 2008-04-27 13:26:59,074 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [templateDir] 2008-04-27 13:26:59,074 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [templateDir] 2008-04-27 13:26:59,074 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [theme] 2008-04-27 13:26:59,074 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [theme] 2008-04-27 13:26:59,076 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [templateDir] 2008-04-27 13:26:59,077 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [templateDir] 2008-04-27 13:26:59,077 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [theme] 2008-04-27 13:26:59,077 WARN [http-8080-Processor24] [OgnlValueStack] Could not find property [theme] --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org