Hi! I thought about that problem today and my idea was (really bloody still):
1.) have a LRU cache (size configurable) which caches Type,List<Bean<?>> 2.) have a LRU cache which caches elname, List<Bean> (need to think about that one more) 3.) each Context implementation could have a small cache which e.g. caches the last 1000 requested items. This would even be implementable for 3rd party contexts 4.) if possible cache the instance inside a normalscoped bean handler. Not sure if this is doable somehow though! LieGrue, strub --- Joseph Bergmark <[email protected]> schrieb am Di, 23.2.2010: > Von: Joseph Bergmark <[email protected]> > Betreff: Re: InjectionResolver.implResolveByName performance > An: [email protected] > Datum: Dienstag, 23. Februar, 2010 20:06 Uhr > Along with the ordering idea, I > wonder if we couldn't optimize this code > path somewhat. We know that we are going to be > invoked on almost every EL > expression (if not every EL expression). It seems > like copying that list of > all beans, just to iterate over it looking for a bean with > a given name is > kind of expensive. I wonder if we couldn't have a > less expensive operation > we could call internally when we aren't afraid of exposing > the list. > > Sincerely, > > Joe > > > On Tue, Feb 23, 2010 at 7:05 AM, Mark Struberg <[email protected]> > wrote: > > > oki sure, I will defer this patch until after we ship > M4! > > > > txs and LieGrue, > > strub > > > > --- Gurkan Erdogdu <[email protected]> > schrieb am Di, 23.2.2010: > > > > > Von: Gurkan Erdogdu <[email protected]> > > > Betreff: Re: InjectionResolver.implResolveByName > performance > > > An: [email protected] > > > Datum: Dienstag, 23. Februar, 2010 12:54 Uhr > > > >>>@all: please note that > > > this will make webbeans-jsf a JSF-2.0 component. > > > Is this ok? We could still provide a JSF-1.2 > branch of that > > > later if we > > > like. > > > What is the meaning of " + > > > > <name>org.apache.openwebbeans</name>"? > > > > > > Look at it after M4 release. I do not break > something huge > > > before M4 > > > release. > > > > > > 2010/2/23 Mark Struberg <[email protected]> > > > > > > > Martin, can you please fill a Jira? > > > > > > > > I already implemented that (with Jakob > helping me). > > > > > > > > The only thing we need to do is to upgrade > our > > > faces-config.xml in > > > > webbeans-jsf: > > > > > > > > -<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" > > > > +<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee" > > > > xmlns:xi="http://www.w3.org/2001/XInclude" > > > > - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > > > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee > > > > http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> > > > > + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > > > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee > > > > http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"> > > > > + > <name>org.apache.openwebbeans</name> > > > > <application> > > > > > > > > > > > > > > <view-handler>org.apache.webbeans.jsf.ConversationAwareViewHandler</view-handler> > > > > > <el-resolver>org.apache.webbeans.el.WebBeansELResolver</el-resolver> > > > > > > > > > > > > @all: please note that this will make > webbeans-jsf a > > > JSF-2.0 component. Is > > > > this ok? We could still provide a JSF-1.2 > branch of > > > that later if we like. > > > > > > > > LieGrue, > > > > strub > > > > > > > > > > > > --- Martin Koci <[email protected]> > > > schrieb am Mo, 22.2.2010: > > > > > > > > > Von: Martin Koci <[email protected]> > > > > > Betreff: Re: > InjectionResolver.implResolveByName > > > performance > > > > > An: [email protected] > > > > > Datum: Montag, 22. Februar, 2010 22:01 > Uhr > > > > > > > > > > Yes, WebBeansELResolver tries to > resolve every > > > bean. > > > > > Very simple solution was to use JSF 2.0 > artifact > > > ordering > > > > > and put > > > > > <others/> element as last one but > this > > > solution > > > > > unfortunately has > > > > > influence on other unnamed or JSF 1.2 > based > > > artifact. > > > > > > > > > > Do you think it is possible to > modify OWB > > > built for > > > > > delivering JSF 2.0 > > > > > named artifact? It will help many > projects with > > > migration > > > > > from managed > > > > > beans and spring to CDI. > > > > > > > > > > Example: > > > > > > > > > > <absolute-ordering> > > > > > > > > > > > <name>my_excelent_renderkit</name> > > > > > > > > > <name>openwebbeans</name> > > > > > <others > /> > > > > > </absolute-ordering> > > > > > > > > > > > > > > > Joseph Bergmark píše v Po 22. 02. > 2010 v 15:34 > > > -0500: > > > > > > I believe the issue is that our EL > resolver > > > is first > > > > > in the chain, so gets > > > > > > called every single time even if > the > > > expression does > > > > > not turn out to be one > > > > > > that references a CDI bean. > 2 million > > > does seem > > > > > like a very large number of > > > > > > times though. > > > > > > > > > > > > Sincerely, > > > > > > > > > > > > Joe > > > > > > > > > > > > On Mon, Feb 22, 2010 at 3:32 PM, > Mark > > > Struberg <[email protected]> > > > > > wrote: > > > > > > > > > > > > > Thanks Martin! > > > > > > > > > > > > > > And yes, this may be a > problem, though > > > not sure > > > > > where it comes from ... > > > > > > > > > > > > > > :) > > > > > > > > > > > > > > LieGrue, > > > > > > > strub > > > > > > > > > > > > > > --- Martin Koci <[email protected]> > > > > > schrieb am Mo, 22.2.2010: > > > > > > > > > > > > > > > Von: Martin Koci <[email protected]> > > > > > > > > Betreff: > > > InjectionResolver.implResolveByName > > > > > performance > > > > > > > > An: [email protected] > > > > > > > > Datum: Montag, 22. > Februar, 2010 > > > 21:28 Uhr > > > > > > > > Hi, > > > > > > > > > > > > > > > > I did some profiling > and > > > YourKitProfiler > > > > > always marks > > > > > > > > > > > InjectionResolver.implResolveByName as > > > > > hotspot. It is > > > > > > > > called over 2 > > > > > > > > mills. times per > request/response. > > > All those > > > > > calls come > > > > > > > > from > > > > > > > > ELResolver.getValue() - > its is a > > > very non > > > > > trivial JSF > > > > > > > > view so it is > > > > > > > > probably ok (even two > milions) and > > > in > > > > > application is no CDI > > > > > > > > bean yet > > > > > > > > (all are still > spring and > > > jsf > > > > > managed). > > > > > > > > Do you think it is a > problem? > > > > > > > > > > > > > > > > Regards, > > > > > > > > > > > > > > > > Martin Kočí > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > __________________________________________________ > > > > > > > Do You Yahoo!? > > > > > > > Sie sind Spam leid? Yahoo! > Mail > > > verfügt über > > > > > einen herausragenden Schutz > > > > > > > gegen Massenmails. > > > > > > > http://mail.yahoo.com > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > __________________________________________________ > > > > Do You Yahoo!? > > > > Sie sind Spam leid? Yahoo! Mail verfügt > über einen > > > herausragenden Schutz > > > > gegen Massenmails. > > > > http://mail.yahoo.com > > > > > > > > > > > > > > > > -- > > > Gurkan Erdogdu > > > http://gurkanerdogdu.blogspot.com > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Sie sind Spam leid? Yahoo! Mail verfügt über einen > herausragenden Schutz > > gegen Massenmails. > > http://mail.yahoo.com > > > __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com
