struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeromy Evans <jeromy.ev...@blueskyminds.com.au>
Subject Re: Struts 2 - Where does all the CPU go
Date Sun, 27 Apr 2008 03:53:38 GMT
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


Mime
View raw message