The only difference between Tag and BodyTag in the Orion implementation is
in BodyTags, pageContext.pushBody() and pageContext.popBody() are called.
These methods create (or possibly pull from a pool) a BodyContent object
(essentially just a JspWriter). Using BodyTag does add a few more lines to
the produced servlet, but I'm not terribly worried about this.

I tried some spartan tests (I timed how long it took to execute each tag),
but I could not discern any difference at all.

The reason I'm concerned with this is that I have a super class tag that I
extend all of the other tags in my project from. It would be more elegant if
I could abstract out the differences and have a single BodyTag-based super
class. I guess the real question is does the overhead for creating a new
JspWriter instance per tag outweigh the design benefits. Right now I don't
think it does, however you guys have a lot more experience than I do.

Thanks,
Bob


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 13, 2001 2:02 AM
Subject: Re: Tag Performance


> It rather depends on what you mean by "performance penalties", but the
> container will almost certainly not treat them identically.
>
> Extending BodyTagSupport instead of TagSupport has a number of
implications.
> As Shawn Bayern has noted, using the latter avoids the creation of objects
> which might otherwise be unnecessary. However, my own experience points to
a
> much more serious problem.
>
> Many of the people who write JSP pages do not realise that each page will
be
> compiled into a Java servlet. Of those that do, many do not realise that
the
> entire page will be compiled into a single method. Of those that realise
> that also, very few realise that there is a JVM-imposed limit on the
> bytecode size of a compiled Java method.
>
> The bottom line is that, if your JSP page generates too much Java code, it
> will cause the relatively obscure "Illegal target of jump or branch"
error,
> which is *extremely* hard to deal with. I tried to describe the options
> available in this situation in the following reference:
>
> http://www.mail-archive.com/[email protected]/msg04902.html
>
> --
> Martin Cooper
>
>
> ----- Original Message -----
> From: "Bob Lee" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, September 11, 2001 3:35 PM
> Subject: Tag Performance
>
>
> Does extending BodyTagSupport over TagSupport have significant
> performance penalties, or does the container treat them identically?
>
> Thanks,
> Bob
>
>
>

Reply via email to