You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shuai Zheng <zh...@gmail.com> on 2007/02/26 07:29:47 UTC

The performance issue about OGNL

Dear All,

I am using struts 2.0.6, but honestly the performance is very bad (not need
to think about scalability), to speed to load a simple page is much slower
than pure JSP (I haven't compared with struts 1). To refresh one page it is
3-5 seconds with only one user. The profiler tells me the OGNL is the
bottleneck.

I notice that there are some complains on OGNL about the performance
already, may I know any other way to replace OGNL with anything else to get
a faster speed? Currently the speed is not acceptable for production.

Regards,

Zheng Shuai

Re: html:button

Posted by Romu <ro...@gmail.com>.
try with html tag may be ?

<html:button property="ok" value="Ok" onclick="validateSomething()" />





2007/2/27, Romu <ro...@gmail.com>:
>
> <html:button property="ok" value="Ok" onclick="validateSomething()" />
>
>
>
>
> 2007/2/26, Michael Jouravlev <jm...@gmail.com>:
> >
> > I have no idea, but does it work without Javascript assigned to the
> > button?
> >
> > On 2/25/07, Strachan, Paul <Pa...@det.nsw.edu.au> wrote:
> > > Hi,
> > >
> > > I realise this is probably not a struts problem and I feel a bit silly
> > posting this question but here goes:
> > >
> > > I'm using html:button with EventDispatchAction but my button
> > properties do not appear in the request - the html source fragment goes
> > something like:
> > >
> > > <script type="text/javascript">
> > >   function doEdit(id) {
> > >     document.TeachingMethodForm.teachingMethodId.value=id;
> > >     document.TeachingMethodForm.submit();
> > >   }
> > > </script>
> > > <form name="TeachingMethodForm" method="post"
> > action="/eat3/admin/teachingMethods.do">
> > >   <input type="hidden" name="applicationId" value="486">
> > >   <input type="hidden" name="teachingMethodId" value="">
> > > ...
> > >  <td>
> > >    <input type="button" name="edit" value="Edit"
> > onclick="javascript:doEdit('100');">
> > >  </td>
> > > ...
> > > </form>
> > >
> > > Using Firefox the request header looks like:
> > >
> > > http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
> > > POST /eat3/admin/teachingMethods.do HTTP/1.1
> > > Host: xxx.xxx.43.6:8988
> > > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2)
> > Gecko/20070219 Firefox/2.0.0.2
> > > Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9
> > ,text/plain;q=0.8,image/png,*/*;q=0.5
> > > Accept-Language: en-us,en;q=0.5
> > > Accept-Encoding: gzip,deflate
> > > Accept-Charset: ISO-8859-1,utf-8;q= 0.7,*;q=0.7
> > > Keep-Alive: 300
> > > Proxy-Connection: keep-alive
> > > Referer: http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
> > > Cookie: JSESSIONID=996b2b06231c8176feb489f64b56816acb4b73a11148
> > > Content-Type: application/x-www-form-urlencoded
> > > Content-Length: 144
> > > applicationId=486&teachingMethodId=100
> > > HTTP/1.x 200 OK
> > > Transfer-Encoding: chunked
> > > Date: Mon, 26 Feb 2007 07:40:07 GMT
> > > Content-Type: text/html;charset=windows-1252
> > > Server: Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)
> > > Content-Location:
> > http://xxx.xxx.43.6:8988/eat3/WEB-INF/jsps/set_layout/layout.jsp
> > > Via: 1.1 ugcpx03 (NetCache NetApp/6.0.5)
> > >
> > > I am expecting to see "edit=Edit" in the request and I dont understand
> > why its not there.  This is contrary to the taglib documentation.
> > >
> > > Any hints?
> > >
> > > Thanks,
> > > Paul
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

Re: html:button

Posted by Romu <ro...@gmail.com>.
<html:button property="ok" value="Ok" onclick="validateSomething()" />

n


2007/2/26, Michael Jouravlev <jm...@gmail.com>:
>
> I have no idea, but does it work without Javascript assigned to the
> button?
>
> On 2/25/07, Strachan, Paul <Pa...@det.nsw.edu.au> wrote:
> > Hi,
> >
> > I realise this is probably not a struts problem and I feel a bit silly
> posting this question but here goes:
> >
> > I'm using html:button with EventDispatchAction but my button properties
> do not appear in the request - the html source fragment goes something like:
> >
> > <script type="text/javascript">
> >   function doEdit(id) {
> >     document.TeachingMethodForm.teachingMethodId.value=id;
> >     document.TeachingMethodForm.submit();
> >   }
> > </script>
> > <form name="TeachingMethodForm" method="post"
> action="/eat3/admin/teachingMethods.do">
> >   <input type="hidden" name="applicationId" value="486">
> >   <input type="hidden" name="teachingMethodId" value="">
> > ...
> >  <td>
> >    <input type="button" name="edit" value="Edit"
> onclick="javascript:doEdit('100');">
> >  </td>
> > ...
> > </form>
> >
> > Using Firefox the request header looks like:
> >
> > http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
> > POST /eat3/admin/teachingMethods.do HTTP/1.1
> > Host: xxx.xxx.43.6:8988
> > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2)
> Gecko/20070219 Firefox/2.0.0.2
> > Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9
> ,text/plain;q=0.8,image/png,*/*;q=0.5
> > Accept-Language: en-us,en;q=0.5
> > Accept-Encoding: gzip,deflate
> > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> > Keep-Alive: 300
> > Proxy-Connection: keep-alive
> > Referer: http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
> > Cookie: JSESSIONID=996b2b06231c8176feb489f64b56816acb4b73a11148
> > Content-Type: application/x-www-form-urlencoded
> > Content-Length: 144
> > applicationId=486&teachingMethodId=100
> > HTTP/1.x 200 OK
> > Transfer-Encoding: chunked
> > Date: Mon, 26 Feb 2007 07:40:07 GMT
> > Content-Type: text/html;charset=windows-1252
> > Server: Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)
> > Content-Location:
> http://xxx.xxx.43.6:8988/eat3/WEB-INF/jsps/set_layout/layout.jsp
> > Via: 1.1 ugcpx03 (NetCache NetApp/6.0.5)
> >
> > I am expecting to see "edit=Edit" in the request and I dont understand
> why its not there.  This is contrary to the taglib documentation.
> >
> > Any hints?
> >
> > Thanks,
> > Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: html:button

Posted by Michael Jouravlev <jm...@gmail.com>.
I have no idea, but does it work without Javascript assigned to the button?

On 2/25/07, Strachan, Paul <Pa...@det.nsw.edu.au> wrote:
> Hi,
>
> I realise this is probably not a struts problem and I feel a bit silly posting this question but here goes:
>
> I'm using html:button with EventDispatchAction but my button properties do not appear in the request - the html source fragment goes something like:
>
> <script type="text/javascript">
>   function doEdit(id) {
>     document.TeachingMethodForm.teachingMethodId.value=id;
>     document.TeachingMethodForm.submit();
>   }
> </script>
> <form name="TeachingMethodForm" method="post" action="/eat3/admin/teachingMethods.do">
>   <input type="hidden" name="applicationId" value="486">
>   <input type="hidden" name="teachingMethodId" value="">
> ...
>  <td>
>    <input type="button" name="edit" value="Edit" onclick="javascript:doEdit('100');">
>  </td>
> ...
> </form>
>
> Using Firefox the request header looks like:
>
> http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
> POST /eat3/admin/teachingMethods.do HTTP/1.1
> Host: xxx.xxx.43.6:8988
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2
> Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> Accept-Language: en-us,en;q=0.5
> Accept-Encoding: gzip,deflate
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> Keep-Alive: 300
> Proxy-Connection: keep-alive
> Referer: http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
> Cookie: JSESSIONID=996b2b06231c8176feb489f64b56816acb4b73a11148
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 144
> applicationId=486&teachingMethodId=100
> HTTP/1.x 200 OK
> Transfer-Encoding: chunked
> Date: Mon, 26 Feb 2007 07:40:07 GMT
> Content-Type: text/html;charset=windows-1252
> Server: Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)
> Content-Location: http://xxx.xxx.43.6:8988/eat3/WEB-INF/jsps/set_layout/layout.jsp
> Via: 1.1 ugcpx03 (NetCache NetApp/6.0.5)
>
> I am expecting to see "edit=Edit" in the request and I dont understand why its not there.  This is contrary to the taglib documentation.
>
> Any hints?
>
> Thanks,
> Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: html:button

Posted by Romu <ro...@gmail.com>.
the name of your form is not correct :

TeachingMethodForm --> should be teachingMethodForm.

it could be annoying.

could u post the place ( struts-config) where u declare your form?
<form-bean
            name="teachingMethodForm"
            type="packagename etc.TeachingMethodForm"
        />



2007/2/26, Strachan, Paul <Pa...@det.nsw.edu.au>:
>
> Hi,
>
> I realise this is probably not a struts problem and I feel a bit silly
> posting this question but here goes:
>
> I'm using html:button with EventDispatchAction but my button properties do
> not appear in the request - the html source fragment goes something like:
>
> <script type="text/javascript">
>   function doEdit(id) {
>     document.TeachingMethodForm.teachingMethodId.value=id;
>     document.TeachingMethodForm.submit();
>   }
> </script>
> <form name="TeachingMethodForm" method="post"
> action="/eat3/admin/teachingMethods.do">
>   <input type="hidden" name="applicationId" value="486">
>   <input type="hidden" name="teachingMethodId" value="">
> ...
> <td>
>    <input type="button" name="edit" value="Edit"
> onclick="javascript:doEdit('100');">
> </td>
> ...
> </form>
>
> Using Firefox the request header looks like:
>
> http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
> POST /eat3/admin/teachingMethods.do HTTP/1.1
> Host: xxx.xxx.43.6:8988
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2)
> Gecko/20070219 Firefox/2.0.0.2
> Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9
> ,text/plain;q=0.8,image/png,*/*;q=0.5
> Accept-Language: en-us,en;q=0.5
> Accept-Encoding: gzip,deflate
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> Keep-Alive: 300
> Proxy-Connection: keep-alive
> Referer: http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
> Cookie: JSESSIONID=996b2b06231c8176feb489f64b56816acb4b73a11148
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 144
> applicationId=486&teachingMethodId=100
> HTTP/1.x 200 OK
> Transfer-Encoding: chunked
> Date: Mon, 26 Feb 2007 07:40:07 GMT
> Content-Type: text/html;charset=windows-1252
> Server: Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)
> Content-Location:
> http://xxx.xxx.43.6:8988/eat3/WEB-INF/jsps/set_layout/layout.jsp
> Via: 1.1 ugcpx03 (NetCache NetApp/6.0.5)
>
> I am expecting to see "edit=Edit" in the request and I dont understand why
> its not there.  This is contrary to the taglib documentation.
>
> Any hints?
>
> Thanks,
> Paul
>
>
>
> **********************************************************************
> This message is intended for the addressee named and may contain
> privileged information or confidential information or both. If you
> are not the intended recipient please delete it and notify the sender.
> **********************************************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

html:button

Posted by "Strachan, Paul" <Pa...@det.nsw.edu.au>.
Hi,

I realise this is probably not a struts problem and I feel a bit silly posting this question but here goes:

I'm using html:button with EventDispatchAction but my button properties do not appear in the request - the html source fragment goes something like:

<script type="text/javascript">
  function doEdit(id) {
    document.TeachingMethodForm.teachingMethodId.value=id;
    document.TeachingMethodForm.submit();
  }
</script>
<form name="TeachingMethodForm" method="post" action="/eat3/admin/teachingMethods.do">
  <input type="hidden" name="applicationId" value="486">
  <input type="hidden" name="teachingMethodId" value="">
...
 <td>
   <input type="button" name="edit" value="Edit" onclick="javascript:doEdit('100');">
 </td>
...
</form>
 
Using Firefox the request header looks like:         
 
http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
POST /eat3/admin/teachingMethods.do HTTP/1.1
Host: xxx.xxx.43.6:8988
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Proxy-Connection: keep-alive
Referer: http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
Cookie: JSESSIONID=996b2b06231c8176feb489f64b56816acb4b73a11148
Content-Type: application/x-www-form-urlencoded
Content-Length: 144
applicationId=486&teachingMethodId=100
HTTP/1.x 200 OK
Transfer-Encoding: chunked
Date: Mon, 26 Feb 2007 07:40:07 GMT
Content-Type: text/html;charset=windows-1252
Server: Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)
Content-Location: http://xxx.xxx.43.6:8988/eat3/WEB-INF/jsps/set_layout/layout.jsp
Via: 1.1 ugcpx03 (NetCache NetApp/6.0.5)
 
I am expecting to see "edit=Edit" in the request and I dont understand why its not there.  This is contrary to the taglib documentation.
 
Any hints?
 
Thanks,
Paul
 
 
 
**********************************************************************
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**********************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: The performance issue about OGNL

Posted by Ted Husted <hu...@apache.org>.
Can you post a copy of the page? We really need to drum up a set of
benchmarks to run ourselves, and this type of page sounds like it
would be a good test case.

Back in the day, there was a common phenomenon where if a page hit
fifty JSP tags, performance suddenly bottomed out. I wonder if some of
these reports are based on some other magic number being hit.

When people do report benchmarks, Struts 2 and WebWork come back
neck-and-neck. There are many thousands of responsive and attractive
WebWork applications in production today, including Confluence and
JiveForums.

There are techniques that can be used, like extracting the FTL
templates to the file system, which seem to boost the page rendering
speed for some applications.

-Ted.

On 2/26/07, Shuai Zheng <zh...@gmail.com> wrote:
> Dear All,
>
> I am using struts 2.0.6, but honestly the performance is very bad (not need
> to think about scalability), to speed to load a simple page is much slower
> than pure JSP (I haven't compared with struts 1). To refresh one page it is
> 3-5 seconds with only one user. The profiler tells me the OGNL is the
> bottleneck.
>
> I notice that there are some complains on OGNL about the performance
> already, may I know any other way to replace OGNL with anything else to get
> a faster speed? Currently the speed is not acceptable for production.
>
> Regards,
>
> Zheng Shuai

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] The performance issue about OGNL

Posted by Mike Baroukh <mb...@cardiweb.com>.
Ok.
I understand. I thought that there was no cache at all.
In development, I also need tempalte to be reloaded as soon as possible.
But in production, I don't care at all so this si not, for me, a 
performance issue ...

Thanks

Mike

Vlad2006 a écrit :
> Hi Mike,
>
> As written in the Wiki:
> "Freemarker fails to properly cache templates when they are retrieved from
> the classpath. Copying them to the WEB_APP root allows Freemarker to cache
> them correctly. Freemarker looks at the last modified time of the template
> to determine if it needs to reload the templates. Resources retrieved from
> the classpath have no last modified time, so Freemarker will reload them on
> every request."
>
> Thus I don't think it is possible to fix cache problem without moving
> templates out of the jar. I guess playing with "template_update_delay" you
> could achieve that templates are recompiled very seldom. If it is enough for
> you, why not. As for me, I would like them to be recompiled as soon (with
> small delay) as they changed.
>
> From my experience, more than 90% of all CPU time was spent in Freemarker
> classes (template compilation) when I started using tags with templates.
> After I have moved templates out of the webwork.jar - it is not an issue
> anymore.
>
> Best regards
> Vlad
>
>
> Mike Baroukh wrote:
>   
>>  >If it is your case, you could make it faster, you have to extract 
>> templates
>>  >out of webwork.jar (in your case probably struts.jar) and put them in,
>> for
>>  >example, WEB-INF/templates directory.
>>
>> Just to know, I saw this many times but without doing this and using 
>> only "template_update_delay" in freemarker.properties, I can see many 
>> logs like
>>
>> 2007-02-26 13:28:05,624 DEBUG (freemarker.cache:81) - 
>> template/css_xhtml/form-validate.ftl[fr_FR,utf-8,parsed] cached copy not 
>> yet stale; using cached
>>
>>
>> So do you think the log is wrong and cache is not used or has the  
>> loading template from classpath been corrected ?
>>
>> Mike
>>
>>
>> Vlad2006 a écrit :
>>     
>>> Hi Zheng,
>>>
>>> Have you profiled your application? Are you sure it is OGNL that makes
>>> your
>>> application slow?
>>>
>>> From my experience it is not so slow. At least I have not found it too be
>>> a
>>> bottleneck in my application. Not yet :-).
>>>
>>> What is really slow in WebWork/Struts2 is jsp tags like, textfield,
>>> radio,
>>> anchor, and other which are using FreeMarker templates.
>>>
>>> If it is your case, you could make it faster, you have to extract
>>> templates
>>> out of webwork.jar (in your case probably struts.jar) and put them in,
>>> for
>>> example, WEB-INF/templates directory.
>>> There is a page on WebWork Wiki about it:
>>> http://wiki.opensymphony.com/display/WW/Performance+Tuning
>>>
>>> I am not using Struts2 yet, but I believe most of the tips will work for
>>> Struts2.
>>>
>>> One more thing that could make application slower is when resource
>>> bundles
>>> are constantly reloaded. It is good for dev but not acceptable for
>>> production. Check in struts property like: webwork.i18n.reload=false
>>>
>>>
>>> Best regards
>>> Vlad
>>>
>>>
>>>
>>> Shuai Zheng wrote:
>>>   
>>>       
>>>> Dear All,
>>>>
>>>> I am using struts 2.0.6, but honestly the performance is very bad (not
>>>> need
>>>> to think about scalability), to speed to load a simple page is much
>>>> slower
>>>> than pure JSP (I haven't compared with struts 1). To refresh one page it
>>>> is
>>>> 3-5 seconds with only one user. The profiler tells me the OGNL is the
>>>> bottleneck.
>>>>
>>>> I notice that there are some complains on OGNL about the performance
>>>> already, may I know any other way to replace OGNL with anything else to
>>>> get
>>>> a faster speed? Currently the speed is not acceptable for production.
>>>>
>>>> Regards,
>>>>
>>>> Zheng Shuai
>>>>
>>>>
>>>>     
>>>>         
>>>   
>>>       
>> -- 
>>
>> Mike Baroukh
>>
>> ---
>> Cardiweb  - 31 Rue de Mogador Paris IXeme
>> 06 63 57 27 22 - 01 53 21 82 63 - Jabber: mbaroukh@jabber.org
>> http://www.cardiweb.com
>> ---
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>     
>
>   


-- 

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: mbaroukh@jabber.org
http://www.cardiweb.com
---



Re: [S2] The performance issue about OGNL

Posted by Vlad2006 <Vl...@yahoo.com>.
Hi Mike,

As written in the Wiki:
"Freemarker fails to properly cache templates when they are retrieved from
the classpath. Copying them to the WEB_APP root allows Freemarker to cache
them correctly. Freemarker looks at the last modified time of the template
to determine if it needs to reload the templates. Resources retrieved from
the classpath have no last modified time, so Freemarker will reload them on
every request."

Thus I don't think it is possible to fix cache problem without moving
templates out of the jar. I guess playing with "template_update_delay" you
could achieve that templates are recompiled very seldom. If it is enough for
you, why not. As for me, I would like them to be recompiled as soon (with
small delay) as they changed.

>From my experience, more than 90% of all CPU time was spent in Freemarker
classes (template compilation) when I started using tags with templates.
After I have moved templates out of the webwork.jar - it is not an issue
anymore.

Best regards
Vlad


Mike Baroukh wrote:
> 
> 
>  >If it is your case, you could make it faster, you have to extract 
> templates
>  >out of webwork.jar (in your case probably struts.jar) and put them in,
> for
>  >example, WEB-INF/templates directory.
> 
> Just to know, I saw this many times but without doing this and using 
> only "template_update_delay" in freemarker.properties, I can see many 
> logs like
> 
> 2007-02-26 13:28:05,624 DEBUG (freemarker.cache:81) - 
> template/css_xhtml/form-validate.ftl[fr_FR,utf-8,parsed] cached copy not 
> yet stale; using cached
> 
> 
> So do you think the log is wrong and cache is not used or has the  
> loading template from classpath been corrected ?
> 
> Mike
> 
> 
> Vlad2006 a écrit :
>> Hi Zheng,
>>
>> Have you profiled your application? Are you sure it is OGNL that makes
>> your
>> application slow?
>>
>> From my experience it is not so slow. At least I have not found it too be
>> a
>> bottleneck in my application. Not yet :-).
>>
>> What is really slow in WebWork/Struts2 is jsp tags like, textfield,
>> radio,
>> anchor, and other which are using FreeMarker templates.
>>
>> If it is your case, you could make it faster, you have to extract
>> templates
>> out of webwork.jar (in your case probably struts.jar) and put them in,
>> for
>> example, WEB-INF/templates directory.
>> There is a page on WebWork Wiki about it:
>> http://wiki.opensymphony.com/display/WW/Performance+Tuning
>>
>> I am not using Struts2 yet, but I believe most of the tips will work for
>> Struts2.
>>
>> One more thing that could make application slower is when resource
>> bundles
>> are constantly reloaded. It is good for dev but not acceptable for
>> production. Check in struts property like: webwork.i18n.reload=false
>>
>>
>> Best regards
>> Vlad
>>
>>
>>
>> Shuai Zheng wrote:
>>   
>>> Dear All,
>>>
>>> I am using struts 2.0.6, but honestly the performance is very bad (not
>>> need
>>> to think about scalability), to speed to load a simple page is much
>>> slower
>>> than pure JSP (I haven't compared with struts 1). To refresh one page it
>>> is
>>> 3-5 seconds with only one user. The profiler tells me the OGNL is the
>>> bottleneck.
>>>
>>> I notice that there are some complains on OGNL about the performance
>>> already, may I know any other way to replace OGNL with anything else to
>>> get
>>> a faster speed? Currently the speed is not acceptable for production.
>>>
>>> Regards,
>>>
>>> Zheng Shuai
>>>
>>>
>>>     
>>
>>   
> 
> 
> -- 
> 
> Mike Baroukh
> 
> ---
> Cardiweb  - 31 Rue de Mogador Paris IXeme
> 06 63 57 27 22 - 01 53 21 82 63 - Jabber: mbaroukh@jabber.org
> http://www.cardiweb.com
> ---
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

-- 
View this message in context: http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9159500
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] The performance issue about OGNL

Posted by Mike Baroukh <mb...@cardiweb.com>.
 >If it is your case, you could make it faster, you have to extract 
templates
 >out of webwork.jar (in your case probably struts.jar) and put them in, for
 >example, WEB-INF/templates directory.

Just to know, I saw this many times but without doing this and using 
only "template_update_delay" in freemarker.properties, I can see many 
logs like

2007-02-26 13:28:05,624 DEBUG (freemarker.cache:81) - 
template/css_xhtml/form-validate.ftl[fr_FR,utf-8,parsed] cached copy not 
yet stale; using cached


So do you think the log is wrong and cache is not used or has the  
loading template from classpath been corrected ?

Mike


Vlad2006 a écrit :
> Hi Zheng,
>
> Have you profiled your application? Are you sure it is OGNL that makes your
> application slow?
>
> From my experience it is not so slow. At least I have not found it too be a
> bottleneck in my application. Not yet :-).
>
> What is really slow in WebWork/Struts2 is jsp tags like, textfield, radio,
> anchor, and other which are using FreeMarker templates.
>
> If it is your case, you could make it faster, you have to extract templates
> out of webwork.jar (in your case probably struts.jar) and put them in, for
> example, WEB-INF/templates directory.
> There is a page on WebWork Wiki about it:
> http://wiki.opensymphony.com/display/WW/Performance+Tuning
>
> I am not using Struts2 yet, but I believe most of the tips will work for
> Struts2.
>
> One more thing that could make application slower is when resource bundles
> are constantly reloaded. It is good for dev but not acceptable for
> production. Check in struts property like: webwork.i18n.reload=false
>
>
> Best regards
> Vlad
>
>
>
> Shuai Zheng wrote:
>   
>> Dear All,
>>
>> I am using struts 2.0.6, but honestly the performance is very bad (not
>> need
>> to think about scalability), to speed to load a simple page is much slower
>> than pure JSP (I haven't compared with struts 1). To refresh one page it
>> is
>> 3-5 seconds with only one user. The profiler tells me the OGNL is the
>> bottleneck.
>>
>> I notice that there are some complains on OGNL about the performance
>> already, may I know any other way to replace OGNL with anything else to
>> get
>> a faster speed? Currently the speed is not acceptable for production.
>>
>> Regards,
>>
>> Zheng Shuai
>>
>>
>>     
>
>   


-- 

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: mbaroukh@jabber.org
http://www.cardiweb.com
---



Re: [S2] The performance issue about OGNL

Posted by Ted Husted <hu...@apache.org>.
> There is a page on WebWork Wiki about it:
> http://wiki.opensymphony.com/display/WW/Performance+Tuning

Phil,

Since you added this page to the WW wiki, did you also want to add it
to the S2 docs?

I would suggest putting it in the Configuration section, between
Wildcard Mappings and Application Servers.

-Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] The performance issue about OGNL

Posted by Tom Schneider <sc...@gmail.com>.
This is not a bug per se.  The xhtml theme extends the simple theme.
If a template doesn't exist in the xhtml theme it will fall back the
simple theme.  From a performance perspective, you simple need to copy
the simple theme hidden.ftl to the xhtml directory.  This will allow
freemarker to cache it properly.

On 2/27/07, Shuai Zheng <zh...@gmail.com> wrote:
> Sorry to disturb again.
>
> This issue is because default the s:hidden tag will use xhtml as theme, but
> actually in the distribution, there is no template/xhtml/hidden.ftl. It
> always get from template/simple/hidden.ftl. But the cache does not know it.
> Then this template is recompiled again and again.
>
> Will report it to JIRA.
>
> A bad news for me, just know my target .net project response time is around
> 0.3 second. Any suggestion to improve the speed? If I use apache work with
> tomcat or any web server, can I get faster speed?
>
> Regards,
>
> Zheng Shuai
>
> On 2/27/07, Shuai Zheng <zh...@gmail.com> wrote:
> >
> > One more thing, this only happens on template/xhtml/hidden.ftl.
> >
> > Should I report this as a bug?
> >
> > On 2/27/07, Shuai Zheng < zhengshuai1979@gmail.com> wrote:
> > >
> > > Dear All,
> > >
> > > Still do research on the debug log and try to get performance
> > > improvement, because I try to beat another .net system on speed(it can shows
> > > all the pages in 0.5 second,sigh).
> > >
> > > One more thing I just find out, if the log does not cheat me:)
> > >
> > > Although I have enabled the property template_update_delay=60000 in
> > > freemarker.properties and also move the template out the jar file.
> > > So there are a lot of log like:
> > > "[freemarker.cache]http-8080-Processor24
> > > template/xhtml/select.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
> > > using cached."
> > > So it looks correct. But also, there are something like followings:
> > >
> > > "Could not find template in cache, creating new one;
> > > id=[template/xhtml/hidden.ftl[en_GB,UTF-8,parsed]"
> > > "template/simple/hidden.ftl[en_GB,UTF-8,parsed] cached copy not yet
> > > stale; using cached."
> > > Above logs occur in the log again and again. I don't know what happened
> > > actually but it shows the hidden.ftl is not cached at all (how can this
> > > happens? when some others are cached?)
> > >
> > > Regards,
> > >
> > > Zheng Shuai
> > >
> > >
> > > On 2/26/07, Vlad2006 < VladKravchenko@yahoo.com> wrote:
> > > >
> > > >
> > > > Hi Zheng,
> > > >
> > > > Have you profiled your application? Are you sure it is OGNL that makes
> > > > your
> > > > application slow?
> > > >
> > > > From my experience it is not so slow. At least I have not found it too
> > > > be a
> > > > bottleneck in my application. Not yet :-).
> > > >
> > > > What is really slow in WebWork/Struts2 is jsp tags like, textfield,
> > > > radio,
> > > > anchor, and other which are using FreeMarker templates.
> > > >
> > > > If it is your case, you could make it faster, you have to extract
> > > > templates
> > > > out of webwork.jar (in your case probably struts.jar) and put them in,
> > > > for
> > > > example, WEB-INF/templates directory.
> > > > There is a page on WebWork Wiki about it:
> > > > http://wiki.opensymphony.com/display/WW/Performance+Tuning
> > > >
> > > > I am not using Struts2 yet, but I believe most of the tips will work
> > > > for
> > > > Struts2.
> > > >
> > > > One more thing that could make application slower is when resource
> > > > bundles
> > > > are constantly reloaded. It is good for dev but not acceptable for
> > > > production. Check in struts property like: webwork.i18n.reload=false
> > > >
> > > >
> > > > Best regards
> > > > Vlad
> > > >
> > > >
> > > >
> > > > Shuai Zheng wrote:
> > > > >
> > > > > Dear All,
> > > > >
> > > > > I am using struts 2.0.6, but honestly the performance is very bad
> > > > (not
> > > > > need
> > > > > to think about scalability), to speed to load a simple page is much
> > > > slower
> > > > > than pure JSP (I haven't compared with struts 1). To refresh one
> > > > page it
> > > > > is
> > > > > 3-5 seconds with only one user. The profiler tells me the OGNL is
> > > > the
> > > > > bottleneck.
> > > > >
> > > > > I notice that there are some complains on OGNL about the performance
> > > > > already, may I know any other way to replace OGNL with anything else
> > > > to
> > > > > get
> > > > > a faster speed? Currently the speed is not acceptable for
> > > > production.
> > > > >
> > > > > Regards,
> > > > >
> > > > > Zheng Shuai
> > > > >
> > > > >
> > > >
> > > > --
> > > > View this message in context:
> > > > http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
> > > > Sent from the Struts - User mailing list archive at Nabble.com.
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] The performance issue about OGNL

Posted by Shuai Zheng <zh...@gmail.com>.
Sorry to disturb again.

This issue is because default the s:hidden tag will use xhtml as theme, but
actually in the distribution, there is no template/xhtml/hidden.ftl. It
always get from template/simple/hidden.ftl. But the cache does not know it.
Then this template is recompiled again and again.

Will report it to JIRA.

A bad news for me, just know my target .net project response time is around
0.3 second. Any suggestion to improve the speed? If I use apache work with
tomcat or any web server, can I get faster speed?

Regards,

Zheng Shuai

On 2/27/07, Shuai Zheng <zh...@gmail.com> wrote:
>
> One more thing, this only happens on template/xhtml/hidden.ftl.
>
> Should I report this as a bug?
>
> On 2/27/07, Shuai Zheng < zhengshuai1979@gmail.com> wrote:
> >
> > Dear All,
> >
> > Still do research on the debug log and try to get performance
> > improvement, because I try to beat another .net system on speed(it can shows
> > all the pages in 0.5 second,sigh).
> >
> > One more thing I just find out, if the log does not cheat me:)
> >
> > Although I have enabled the property template_update_delay=60000 in
> > freemarker.properties and also move the template out the jar file.
> > So there are a lot of log like:
> > "[freemarker.cache]http-8080-Processor24
> > template/xhtml/select.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
> > using cached."
> > So it looks correct. But also, there are something like followings:
> >
> > "Could not find template in cache, creating new one;
> > id=[template/xhtml/hidden.ftl[en_GB,UTF-8,parsed]"
> > "template/simple/hidden.ftl[en_GB,UTF-8,parsed] cached copy not yet
> > stale; using cached."
> > Above logs occur in the log again and again. I don't know what happened
> > actually but it shows the hidden.ftl is not cached at all (how can this
> > happens? when some others are cached?)
> >
> > Regards,
> >
> > Zheng Shuai
> >
> >
> > On 2/26/07, Vlad2006 < VladKravchenko@yahoo.com> wrote:
> > >
> > >
> > > Hi Zheng,
> > >
> > > Have you profiled your application? Are you sure it is OGNL that makes
> > > your
> > > application slow?
> > >
> > > From my experience it is not so slow. At least I have not found it too
> > > be a
> > > bottleneck in my application. Not yet :-).
> > >
> > > What is really slow in WebWork/Struts2 is jsp tags like, textfield,
> > > radio,
> > > anchor, and other which are using FreeMarker templates.
> > >
> > > If it is your case, you could make it faster, you have to extract
> > > templates
> > > out of webwork.jar (in your case probably struts.jar) and put them in,
> > > for
> > > example, WEB-INF/templates directory.
> > > There is a page on WebWork Wiki about it:
> > > http://wiki.opensymphony.com/display/WW/Performance+Tuning
> > >
> > > I am not using Struts2 yet, but I believe most of the tips will work
> > > for
> > > Struts2.
> > >
> > > One more thing that could make application slower is when resource
> > > bundles
> > > are constantly reloaded. It is good for dev but not acceptable for
> > > production. Check in struts property like: webwork.i18n.reload=false
> > >
> > >
> > > Best regards
> > > Vlad
> > >
> > >
> > >
> > > Shuai Zheng wrote:
> > > >
> > > > Dear All,
> > > >
> > > > I am using struts 2.0.6, but honestly the performance is very bad
> > > (not
> > > > need
> > > > to think about scalability), to speed to load a simple page is much
> > > slower
> > > > than pure JSP (I haven't compared with struts 1). To refresh one
> > > page it
> > > > is
> > > > 3-5 seconds with only one user. The profiler tells me the OGNL is
> > > the
> > > > bottleneck.
> > > >
> > > > I notice that there are some complains on OGNL about the performance
> > > > already, may I know any other way to replace OGNL with anything else
> > > to
> > > > get
> > > > a faster speed? Currently the speed is not acceptable for
> > > production.
> > > >
> > > > Regards,
> > > >
> > > > Zheng Shuai
> > > >
> > > >
> > >
> > > --
> > > View this message in context:
> > > http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
> > > Sent from the Struts - User mailing list archive at Nabble.com.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
>

Re: [S2] The performance issue about OGNL

Posted by Shuai Zheng <zh...@gmail.com>.
One more thing, this only happens on template/xhtml/hidden.ftl.

Should I report this as a bug?

On 2/27/07, Shuai Zheng <zh...@gmail.com> wrote:
>
> Dear All,
>
> Still do research on the debug log and try to get performance improvement,
> because I try to beat another .net system on speed(it can shows all the
> pages in 0.5 second,sigh).
>
> One more thing I just find out, if the log does not cheat me:)
>
> Although I have enabled the property template_update_delay=60000 in
> freemarker.properties and also move the template out the jar file.
> So there are a lot of log like:
> "[freemarker.cache]http-8080-Processor24
> template/xhtml/select.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
> using cached."
> So it looks correct. But also, there are something like followings:
>
> "Could not find template in cache, creating new one;
> id=[template/xhtml/hidden.ftl[en_GB,UTF-8,parsed]"
> "template/simple/hidden.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
> using cached."
> Above logs occur in the log again and again. I don't know what happened
> actually but it shows the hidden.ftl is not cached at all (how can this
> happens? when some others are cached?)
>
> Regards,
>
> Zheng Shuai
>
>
> On 2/26/07, Vlad2006 <Vl...@yahoo.com> wrote:
> >
> >
> > Hi Zheng,
> >
> > Have you profiled your application? Are you sure it is OGNL that makes
> > your
> > application slow?
> >
> > From my experience it is not so slow. At least I have not found it too
> > be a
> > bottleneck in my application. Not yet :-).
> >
> > What is really slow in WebWork/Struts2 is jsp tags like, textfield,
> > radio,
> > anchor, and other which are using FreeMarker templates.
> >
> > If it is your case, you could make it faster, you have to extract
> > templates
> > out of webwork.jar (in your case probably struts.jar) and put them in,
> > for
> > example, WEB-INF/templates directory.
> > There is a page on WebWork Wiki about it:
> > http://wiki.opensymphony.com/display/WW/Performance+Tuning
> >
> > I am not using Struts2 yet, but I believe most of the tips will work for
> > Struts2.
> >
> > One more thing that could make application slower is when resource
> > bundles
> > are constantly reloaded. It is good for dev but not acceptable for
> > production. Check in struts property like: webwork.i18n.reload=false
> >
> >
> > Best regards
> > Vlad
> >
> >
> >
> > Shuai Zheng wrote:
> > >
> > > Dear All,
> > >
> > > I am using struts 2.0.6, but honestly the performance is very bad (not
> > > need
> > > to think about scalability), to speed to load a simple page is much
> > slower
> > > than pure JSP (I haven't compared with struts 1). To refresh one page
> > it
> > > is
> > > 3-5 seconds with only one user. The profiler tells me the OGNL is the
> > > bottleneck.
> > >
> > > I notice that there are some complains on OGNL about the performance
> > > already, may I know any other way to replace OGNL with anything else
> > to
> > > get
> > > a faster speed? Currently the speed is not acceptable for production.
> > >
> > > Regards,
> > >
> > > Zheng Shuai
> > >
> > >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

Re: [S2] The performance issue about OGNL

Posted by Shuai Zheng <zh...@gmail.com>.
Dear All,

Still do research on the debug log and try to get performance improvement,
because I try to beat another .net system on speed(it can shows all the
pages in 0.5 second,sigh).

One more thing I just find out, if the log does not cheat me:)

Although I have enabled the property template_update_delay=60000 in
freemarker.properties and also move the template out the jar file.
So there are a lot of log like:
"[freemarker.cache]http-8080-Processor24
template/xhtml/select.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
using cached."
So it looks correct. But also, there are something like followings:

"Could not find template in cache, creating new one;
id=[template/xhtml/hidden.ftl[en_GB,UTF-8,parsed]"
"template/simple/hidden.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
using cached."
Above logs occur in the log again and again. I don't know what happened
actually but it shows the hidden.ftl is not cached at all (how can this
happens? when some others are cached?)

Regards,

Zheng Shuai


On 2/26/07, Vlad2006 <Vl...@yahoo.com> wrote:
>
>
> Hi Zheng,
>
> Have you profiled your application? Are you sure it is OGNL that makes
> your
> application slow?
>
> From my experience it is not so slow. At least I have not found it too be
> a
> bottleneck in my application. Not yet :-).
>
> What is really slow in WebWork/Struts2 is jsp tags like, textfield, radio,
> anchor, and other which are using FreeMarker templates.
>
> If it is your case, you could make it faster, you have to extract
> templates
> out of webwork.jar (in your case probably struts.jar) and put them in, for
> example, WEB-INF/templates directory.
> There is a page on WebWork Wiki about it:
> http://wiki.opensymphony.com/display/WW/Performance+Tuning
>
> I am not using Struts2 yet, but I believe most of the tips will work for
> Struts2.
>
> One more thing that could make application slower is when resource bundles
> are constantly reloaded. It is good for dev but not acceptable for
> production. Check in struts property like: webwork.i18n.reload=false
>
>
> Best regards
> Vlad
>
>
>
> Shuai Zheng wrote:
> >
> > Dear All,
> >
> > I am using struts 2.0.6, but honestly the performance is very bad (not
> > need
> > to think about scalability), to speed to load a simple page is much
> slower
> > than pure JSP (I haven't compared with struts 1). To refresh one page it
> > is
> > 3-5 seconds with only one user. The profiler tells me the OGNL is the
> > bottleneck.
> >
> > I notice that there are some complains on OGNL about the performance
> > already, may I know any other way to replace OGNL with anything else to
> > get
> > a faster speed? Currently the speed is not acceptable for production.
> >
> > Regards,
> >
> > Zheng Shuai
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: [S2] The performance issue about OGNL

Posted by Ted Husted <hu...@apache.org>.
On 2/27/07, Shuai Zheng <zh...@gmail.com> wrote:
> First of all, when I saw Vlad's email, I copy out the template and delete
> the original from struts-core.jar.

You shouldn't have to delete the one in the JAR. The one under WEB-INF
is earlier on the classpath, and it's "first come first served".

Thanks very much for the detailed followup.

-Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] The performance issue about OGNL

Posted by Shuai Zheng <zh...@gmail.com>.
Dear All,

Thanks very much for useful help.

Just fight with this for 24 hours and get some improvement.

I want to apology first because I am so stupid. Last evening I do a
profiling again. The OGNL is not the main bottleneck, but it is still a
problem.

My previous page loading is around 3-5 seconds. Now it is around 1-2
seconds.

First of all, when I saw Vlad's email, I copy out the template and delete
the original from struts-core.jar. It looks well (but I forget to compare
the timing, later i will do it again)

Then I rewrite the page again and enable the DEBUG in log4j to trace it.

Something what I found:
struts.configuration.xml.reload: this parameter in the properties file will
give another 0.3 second to loading time in my case (it is so bad, that I
think it should be mentioned in the document that this feature should be
disabled in production, because you know, in struts.properties of  showcase,
it is enabled.).

There is a list in my page, which includes around 800+ items, I want to show
them in a select list. Previously I get it from database by Hibernate and
directly pass it to the component, this will cause 1 second to finish
construct this select component.
        <s:select
            list="prodList"
            multiple="true"
            listKey="idkey"
            listValue="prodName"
            />
Now I loop it in the class and convert it into a Map<String, String>, then
pass the map to the select, it get around 1 second faster.

Regards,

Zheng Shuai

On 2/26/07, Vlad2006 <Vl...@yahoo.com> wrote:
>
>
> Hi Zheng,
>
> Have you profiled your application? Are you sure it is OGNL that makes
> your
> application slow?
>
> From my experience it is not so slow. At least I have not found it too be
> a
> bottleneck in my application. Not yet :-).
>
> What is really slow in WebWork/Struts2 is jsp tags like, textfield, radio,
> anchor, and other which are using FreeMarker templates.
>
> If it is your case, you could make it faster, you have to extract
> templates
> out of webwork.jar (in your case probably struts.jar) and put them in, for
> example, WEB-INF/templates directory.
> There is a page on WebWork Wiki about it:
> http://wiki.opensymphony.com/display/WW/Performance+Tuning
>
> I am not using Struts2 yet, but I believe most of the tips will work for
> Struts2.
>
> One more thing that could make application slower is when resource bundles
> are constantly reloaded. It is good for dev but not acceptable for
> production. Check in struts property like: webwork.i18n.reload=false
>
>
> Best regards
> Vlad
>
>
>
> Shuai Zheng wrote:
> >
> > Dear All,
> >
> > I am using struts 2.0.6, but honestly the performance is very bad (not
> > need
> > to think about scalability), to speed to load a simple page is much
> slower
> > than pure JSP (I haven't compared with struts 1). To refresh one page it
> > is
> > 3-5 seconds with only one user. The profiler tells me the OGNL is the
> > bottleneck.
> >
> > I notice that there are some complains on OGNL about the performance
> > already, may I know any other way to replace OGNL with anything else to
> > get
> > a faster speed? Currently the speed is not acceptable for production.
> >
> > Regards,
> >
> > Zheng Shuai
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: [S2] The performance issue about OGNL

Posted by Vlad2006 <Vl...@yahoo.com>.
Hi Zheng,

Have you profiled your application? Are you sure it is OGNL that makes your
application slow?

>From my experience it is not so slow. At least I have not found it too be a
bottleneck in my application. Not yet :-).

What is really slow in WebWork/Struts2 is jsp tags like, textfield, radio,
anchor, and other which are using FreeMarker templates.

If it is your case, you could make it faster, you have to extract templates
out of webwork.jar (in your case probably struts.jar) and put them in, for
example, WEB-INF/templates directory.
There is a page on WebWork Wiki about it:
http://wiki.opensymphony.com/display/WW/Performance+Tuning

I am not using Struts2 yet, but I believe most of the tips will work for
Struts2.

One more thing that could make application slower is when resource bundles
are constantly reloaded. It is good for dev but not acceptable for
production. Check in struts property like: webwork.i18n.reload=false


Best regards
Vlad



Shuai Zheng wrote:
> 
> Dear All,
> 
> I am using struts 2.0.6, but honestly the performance is very bad (not
> need
> to think about scalability), to speed to load a simple page is much slower
> than pure JSP (I haven't compared with struts 1). To refresh one page it
> is
> 3-5 seconds with only one user. The profiler tells me the OGNL is the
> bottleneck.
> 
> I notice that there are some complains on OGNL about the performance
> already, may I know any other way to replace OGNL with anything else to
> get
> a faster speed? Currently the speed is not acceptable for production.
> 
> Regards,
> 
> Zheng Shuai
> 
> 

-- 
View this message in context: http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org