[ https://issues.apache.org/jira/browse/OWB-1382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17308798#comment-17308798 ]
Romain Manni-Bucau commented on OWB-1382: ----------------------------------------- Hmm, reviewed a bit your example app and I think we can maybe improve things but didn't get a lot of luck in terms of perf on my computer so if you can test on your actual instance it would help: # hardcode the bean manager injection for observer methods (extensions), patch can look like [https://gist.github.com/rmannibucau/bf562cd3f4fc44593fc05ad3c710502d] (boost is not impressive there so not sure it makes sense) # skip validations which bother you: add "_org.apache.webbeans.spi.deployer.skipValidations=true"_ in owb config - in openwebbeans.properties if you prefer. Perf diff is not impressive but seems to fix what you describe as behavior (I still have most of the startup lost time in tomcat tld/jar scanning until it is configured to be skipped and myfaces bytecode instrumentation after deployment validation). > Class javax.enterprise.inject.spi.BeanManager not cached on start > ----------------------------------------------------------------- > > Key: OWB-1382 > URL: https://issues.apache.org/jira/browse/OWB-1382 > Project: OpenWebBeans > Issue Type: Improvement > Components: Context and Scopes > Reporter: Vladimir Dvorak > Priority: Minor > > Class javax.enterprise.inject.spi.BeanManager generates a lot of full lookups > (tens of thousands) in InjectionResolver.implResolveByType() when OWB is > starting even in simple project. It looks that OWB starts could be improved > by 10-20% by introducing caching. I'm trying to put cache in BeanImpl as is > shown there: > > [https://github.com/skybber/pf-expensive-converter/blob/main/addhoc/org/apache/webbeans/container/InjectionResolver.java#L491] > > it skips expensive iteration over all beans and improves start of OWB, in my > case from 10.5s to 9.9s. Probably there is better way how to do it, since the > problem is only with the class javax.enterprise.inject.spi.BeanManager. > > > -- This message was sent by Atlassian Jira (v8.3.4#803005)