Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2854

Processing @ResourceDependency on each component instance takes too long

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.2-SNAPSHOT
    • 2.0.2
    • General
    • None
    • myfaces current trunk

    Description

      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.

      Attachments

        1. MYFACES-2854-1.patch
          10 kB
          Leonardo Uribe
        2. MYFACES-2854-2.patch
          14 kB
          Leonardo Uribe

        Activity

          People

            lu4242 Leonardo Uribe
            markoc50 Martin Kočí
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: