Just a quick note - my experience so far with server-side performance is
that it doesn't matter how many objects you create, as long as you do it
only once ( and not for each request ).
I don't think doing any reuse inside a page ( i.e. same tag instance
beeing reused during a request ) is worth the effort at this stage -
you'll get most of the benefit and improvements by just using a pool and
reusing the tags from request to request - if possible.
Later you can do more advanced things.
Another note - it would be nice if the pool interface is not very
hardcoded in the implementation. Most of the time there is a sync() that
is hard to avoid in pools, and you get a good improvement by using
thread data ( in a form or another ). This is a bit hard because the
same page may be accessed in multiple threads - so you'll have to keep tag
instances duplicated per thread - but there are solutions to control it
without affecting the response time, and most of the times few pages get
most of the hits - so it's not like all the tags from all the pages will
be cached at all times.
Costin
On Wed, 7 Mar 2001, Casey Lucas wrote:
> I am planning on implementing tag handler pooling and would like
> to throw out a few ideas for feedback:
>
> assumptions:
> - Tag handlers can only be reused if the same set of attributes
> are used for the tag.
>
> - Tag.relese is called only once -- at some point before the
> handler is garbage collected.
>
>
> basic idea:
> My general idea was to have a collection of named pools. Jasper
> could then render code to use the named pool to obtain handler
> instances instead of newing them each time.
>
>
> more info:
> Each tag handler pool would have a name that would include
> the tag's short name and the set of attributes that were used
> on the tag. This would give us the correct reuse level. So
> for the following tags there would be two named pools (after
> taking into account attributes):
>
> <x:tag1 attr1="a" attr2="b"/>
> <x:tag1 attr1="xyz" attr2="123"/>
> <x:tag1 attr1="a"/>
>
> To eliminate the need to lookup the pool by name each time a
> tag was needed, pool references could be rendered and initialized
> (looked up) when the jsp is initialized. Inside the main jsp
> method (_jspService), the pool references would be used directly.
>
> When the pools are removed (shutdown, reload, etc.) Tag.release
> will be called for each of the handlers. I assume that pools need
> to be per web application, but haven't given it a lot of thought.
>
>
> Any comments / suggestions?
>
> -Casey
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]