[ https://issues.apache.org/jira/browse/MYFACES-3481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13217017#comment-13217017 ]
Leonardo Uribe commented on MYFACES-3481: ----------------------------------------- It is not a but, instead it is an improvement. In theory, base tag handler classes should cache TagHandlerDelegate instance, but it seems we forgot to do the same for javax.faces.view.facelets.ValidatorHandler, ConverterHandler and BehaviorHandler. Since f:validateBean has wrap mode, the effect is visible. The fix is very simple. Thanks for notice it. > [perf] f:validateBean re-creates facelets handlers > (MetaRulesetImpl,DelegatingMetaTagHandler ...) for children every time > ------------------------------------------------------------------------------------------------------------------------- > > Key: MYFACES-3481 > URL: https://issues.apache.org/jira/browse/MYFACES-3481 > Project: MyFaces Core > Issue Type: Improvement > Reporter: Martin Kočí > Fix For: 2.0.13, 2.1.7 > > > myfaces in Production stage: > <f:validateBean> > <h:outputLabel>myfaces</h:outputLabel> > </f:validateBean> > (or book.xhtml in myfaces-jpa test app) > In every request/response, this invocation appears: > MetaRulesetImpl.<init>(Tag, Class<?>) line: 118 > ComponentTagHandlerDelegate.createMetaRuleset(Class) line: 459 > HtmlComponentHandler(DelegatingMetaTagHandler).createMetaRuleset(Class) line: > 102 > HtmlComponentHandler.createMetaRuleset(Class) line: 42 > HtmlComponentHandler(MetaTagHandler).setAttributes(FaceletContext, Object) > line: 63 > HtmlComponentHandler(DelegatingMetaTagHandler).setAttributes(FaceletContext, > Object) line: 93 > ComponentTagHandlerDelegate.apply(FaceletContext, UIComponent) line: 235 > HtmlComponentHandler(DelegatingMetaTagHandler).apply(FaceletContext, > UIComponent) line: 53 > ValidatorTagHandlerDelegate.apply(FaceletContext, UIComponent) line: 152 > ValidatorHandler(DelegatingMetaTagHandler).apply(FaceletContext, UIComponent) > line: 53 > this applies for all children of f:validateBean > Without f:validateBean Metatag rules are created only once in production > stage during initial request to facelet. > (Not sure if it is a bug - maybe something special needs to be done for > f:beanValidator ) > It also leads to stack bellow - but _getFactory method is synchronized and > slow down response times to the same facelet: > FactoryFinder._getFactory(String) line: 259 > FactoryFinder.getFactory(String) line: 206 > ConvertNumberHandler(DelegatingMetaTagHandler).<init>(TagConfig) line: 42 > ConvertNumberHandler(FaceletsAttachedObjectHandler).<init>(TagConfig) line: > 42 > ConvertNumberHandler(ConverterHandler).<init>(ConverterConfig) line: 44 > ConvertNumberHandler.<init>(ConverterConfig) line: 57 > NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) line: not > available [native method] > NativeConstructorAccessorImpl.newInstance(Object[]) line: 39 > DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 27 > Constructor<T>.newInstance(Object...) line: 513 > AbstractTagLibrary$UserConverterHandlerFactory.createHandler(TagConfig) line: > 593 > CoreLibrary(AbstractTagLibrary).createTagHandler(String, String, TagConfig) > line: 98 > CompositeTagLibrary.createTagHandler(String, String, TagConfig) line: 93 > TagUnit.createFaceletHandler() line: 56 > TextUnit.createFaceletHandler() line: 104 > TagUnit(CompilationUnit).getNextFaceletHandler() line: 82 > TagUnit.getNextHandler() line: 61 > AbstractTagLibrary$ComponentConfigWrapper.getNextHandler() line: 431 > HtmlComponentHandler(TagHandler).<init>(TagConfig) line: 39 > HtmlComponentHandler(MetaTagHandler).<init>(TagConfig) line: 35 > HtmlComponentHandler(DelegatingMetaTagHandler).<init>(TagConfig) line: 40 > HtmlComponentHandler(ComponentHandler).<init>(ComponentConfig) line: 37 > HtmlComponentHandler.<init>(ComponentConfig) line: 37 > GeneratedConstructorAccessor17.newInstance(Object[]) line: not available > DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 27 > Constructor<T>.newInstance(Object...) line: 513 > AbstractTagLibrary$UserComponentHandlerFactory.createHandler(TagConfig) line: > 519 > HtmlLibrary(AbstractTagLibrary).createTagHandler(String, String, TagConfig) > line: 98 > CompositeTagLibrary.createTagHandler(String, String, TagConfig) line: 93 > TagUnit.createFaceletHandler() line: 56 > TextUnit.createFaceletHandler() line: 104 > TagUnit(CompilationUnit).getNextFaceletHandler() line: 82 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira