myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <>
Subject [jira] Commented: (MYFACES-2854) Processing @ResourceDependency on each component instance takes too long
Date Thu, 05 Aug 2010 03:07:16 GMT


Leonardo Uribe commented on MYFACES-2854:

Here is a new patch integrating the idea of do not apply a ResourceDependency if it was already
done, creating a proper RequestViewContext class. I checked if ri is doing that optimization
and yes, they are doing that and that's the reason why the code is faster.

If no objections I'll commit that patch soon.

> Processing @ResourceDependency on each component instance takes too long
> ------------------------------------------------------------------------
>                 Key: MYFACES-2854
>                 URL:
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces current trunk
>            Reporter: Martin Kočí
>         Attachments: MYFACES-2854-1.patch, MYFACES-2854-2.patch
> 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,
>         _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.

View raw message