tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Annotation processing - Geronimo injection
Date Thu, 24 May 2007 21:22:21 GMT

On May 24, 2007, at 10:10 AM, Remy Maucherat wrote:

> David Jencks wrote:
>> I tend to agree that a new branch is more appropriate.  However,  
>> earlier versions of the patch had a compatibility layer so the old  
>> api could continue to work.  I'm happy to add that back in on  
>> request.
>
> I am examining the patch in detail as part of the new trunk branch  
> (adjusting things like package names), and unfortunately it turns  
> out I still dislike it due to design implications with Jasper.
>
> Modern JSPs now uses lots of tags, and especially lots of  
> SimpleTags, which are not pooled. As a result, the InstanceManager  
> design leads to replacing "new MySimpleTag()" with "newInstance 
> (String className)" (which creates the instance in a much more  
> expensive way). Maybe adding access to InstanceManager.newInstance 
> (Object instance) would be a solution (in effect making  
> InstanceManager an extension of the old AnnotationProcessor).

To reorient myself to this.... these tags can have injected stuff,  
correct?  So it would theoretically be possible to support  
constructor injection on them, with suitable constructor metadata?

Are tags typically created once per jsp instance or once per request  
(or at some other frequency)?

And your objection here is that

new Foo();

is sufficiently faster than

Class fooClass = cl.loadClass("Foo");
Object foo = fooClass.newInstance();

that we should separate the object construction and injection phases?


My thoughts at this time are that:
- if tags are created once per jsp we're only talking a difference in  
startup time which is not important
- it might be worth eliminating the loadClass call in any case
- if tags use injection the cost of looking up the stuff to inject so  
far dwarfs the time to create the object that the single  
InstanceManager.newInstance method still makes sense
- if a tag doesn't use injection and is created once per request (or  
more often) then it would be worth measuring the speed difference and  
possibly modifying the code generator to directly create the tags  
when there are no injections for it.

I haven't done any speed measurements yet, have you?

thanks
david jencks


>
> Rémy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message