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


Reply via email to