[ 
https://issues.apache.org/jira/browse/MYFACES-3481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13217564#comment-13217564
 ] 

Leonardo Uribe commented on MYFACES-3481:
-----------------------------------------

I see. This is different to the previous one fixed, and is caused by this call.

_delegate.getValidatorConfig().getNextHandler().apply(ctx, parent);

Tracking down this problem, it came from MYFACES-2512. In that time, we tried 
to implement the "disabled" logic into ValidatorTagHandlerDelegate, but after 
some tests cycles, we found that the right thing to do is move that logic into 
ComponentTagHandlerDelegate. Later, to solve validationGroups problem, another 
strategy was implemented, so we commented the old code, but this line was let 
without change. The solution is just use:

_delegate.applyNextHandler(ctx, parent);

Instead. The problem described on MYFACES-2512 will not happen, because all 
that code was changed in MYFACES-3259 with a better alternative. 
                
> [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čí
>            Assignee: Leonardo Uribe
>             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


Reply via email to