You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2010/08/03 20:42:19 UTC

[jira] Commented: (MYFACES-2854) Processing @ResourceDependency on each component instance takes too long

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

Leonardo Uribe commented on MYFACES-2854:
-----------------------------------------

I think the problem is in UIViewRoot.addComponentResource. Each time a component resouce is added from an annotation, all resources are scanned, by an algorithm that prevent StackOverflowException.

Multiple changes has been done in this part, so I don't know if that code is still valid. I'll check it to see if we can enhance it.

> Processing @ResourceDependency on each component instance takes too long
> ------------------------------------------------------------------------
>
>                 Key: MYFACES-2854
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2854
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces current trunk
>            Reporter: Martin Kočí
>
> Consider custom renderer with @ResourceDependencies (and many @ResourceDependency here). If a view has 500 UIComponent with this custom renderer, ApplicationImpl._handleAnnotations process the same set of ResourceDependecies again and again.
> With my test scenario, VDL.buildView takes therefore  750ms. After small modification in ApplicationImpl _handleAnnotations it takes only 70 ms. 
> The modification can be like:
> Class<?> inspectedClass = inspected.getClass();
>      
> // Process annotation only if this is the first creation of component(renderer,validator, converter) of particular type in this request/response
>         if (! context.getAttributes().containsKey(inspectedClass.getName())) { 
>         _handleListenerForAnnotations(context, inspected, inspectedClass, component, isProduction);
>         _handleResourceDependencyAnnotations(context, inspectedClass, component, isProduction);
>     // Remeber here that this class and it's dependencies are in viewRoot.componentResources 
>             context.getAttributes().put(inspectedClass.getName(), Boolean.TRUE);
>         }
> ;
> But I'm not sure what specification says about this processing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.