You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rajan Gupta <rg...@yahoo.com> on 2001/02/04 22:24:36 UTC

Performance Issues with Struts

Has anybody used Struts in a largescale application and witnessed
performance issues. It seems to me that the cost of creating & destroying
tags in a JSP page would create a lot of overhead on the JVM. By putting
all HTML elements as tags would there be not a significant overhead of
creating & destroying the tags. Of course the destroying would be handled
by the garbage collector, but that could get significant.
If all HTML code are tags, simple IF-ELSE statements are also tags and
typically you could have more than 2-5 IF statements in a page.

Is there some type of optimization built in struts to handle it or I am
missing something in my understanding.

Thx in advance for your responses.
Rajan




__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Re: Performance Issues with Struts

Posted by Wong Kok Wai <wo...@yahoo.com>.
Tag instance creation aside, I don't see how a smart
JSP page compiler can optimise away the method calls
to the tag: Looking at page 107 of the JSP 1.1 specs,
it is obvious there are alot of overhead for using a
tag. Don't get me wrong: I love tag lib in general,
especially Struts, which make it possible to
componentise the web tier. However, IHMO tag is not
suitable for all cases and a developer has to choose
to use them selectively.

--- "Craig R. McClanahan"
<Cr...@eng.sun.com> wrote:
> 
> As above, you are starting from an incorrect
> assumption about tag instance
> creation.  A smarter JSP page compiler will do a
> much better job than current
> implementations do -- and this will be a particular
> area of focus in Tomcat
> 4.0 as time goes on.
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/

Re: Performance Issues with Struts

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Rajan Gupta wrote:

> Has anybody used Struts in a largescale application and witnessed
> performance issues. It seems to me that the cost of creating & destroying
> tags in a JSP page would create a lot of overhead on the JVM.

There is no requirement that custom tag instances be created and destroyed
every time.  In fact, the spec has a lot of explicit stuff to enable pooling
of custom tag instances that have the same set of attribute values
specified.  Many servlet containers (including Tomcat) do not yet take
advantage of this, and generate pretty stupid code.

One other thing to note -- the overhead cost of object creation and
destruction varies by VM, but in general is *substantially* lower in modern
1.2 and 1.3 VMs, so the whole issue has less performance impact than it used
to.

> By putting
> all HTML elements as tags would there be not a significant overhead of
> creating & destroying the tags. Of course the destroying would be handled
> by the garbage collector, but that could get significant.
> If all HTML code are tags, simple IF-ELSE statements are also tags and
> typically you could have more than 2-5 IF statements in a page.
>

As above, you are starting from an incorrect assumption about tag instance
creation.  A smarter JSP page compiler will do a much better job than current
implementations do -- and this will be a particular area of focus in Tomcat
4.0 as time goes on.

>
> Is there some type of optimization built in struts to handle it or I am
> missing something in my understanding.
>
> Thx in advance for your responses.
> Rajan
>

Craig McClanahan



Re: Performance Issues with Struts

Posted by Wong Kok Wai <wo...@yahoo.com>.
Actually what you've described applies for any tag
lib. My approach is use Struts (or any tag lib)
selectively. For example, I would use <html:form> tag
but use HTML for the input elements. Instead of using
<bean:write>, I would use scriptlets to print the
information. Same goes for tags like
<logic:ifPresent>, <logic:ifNotPresent>, etc...


--- Rajan Gupta <rg...@yahoo.com> wrote:
> Has anybody used Struts in a largescale application
> and witnessed
> performance issues. It seems to me that the cost of
> creating & destroying
> tags in a JSP page would create a lot of overhead on
> the JVM. By putting
> all HTML elements as tags would there be not a
> significant overhead of
> creating & destroying the tags. Of course the
> destroying would be handled
> by the garbage collector, but that could get
> significant.
> If all HTML code are tags, simple IF-ELSE statements
> are also tags and
> typically you could have more than 2-5 IF statements
> in a page.
> 
> Is there some type of optimization built in struts
> to handle it or I am
> missing something in my understanding.
> 
> Thx in advance for your responses.
> Rajan
> 
> 


__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

forms with arrays

Posted by John Hunt <te...@yahoo.com>.
Hi
I have a variable number of combo,text pairs ( like
name value pairs ).
If I use struts form, it would lead me to have
variable number of calls if I have a direct mapping
with the input fields.
So I want to use arrays. I want to associate the name
value pairs ( combo to text ). From the form bean
perspective how can I recognize the mapping? As to
which combos the user chose because they go under the
same name as I am using an array.
Thanks
Hunt

__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/