ICEfaces
  1. ICEfaces
  2. ICE-3730

Optimise UIComponent.getRenderer() accesses

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 1.8DR#1
    • Fix Version/s: None
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      All (JSF 1.2?)

      Description

      Throughout the JSF framework, UIComponent objects delegate behaviours to their Renderer, which is accomplished in UIComponentBase by:

          Renderer result = context.getRenderKit().getRenderer(getFamily(), getRendererType());

      The call to FacesContext.getRenderKit() takes up the majority of acccessing the Renderer. In JSF 1.2, their FacesContextImpl class does the following for getRenderKit():

           private RenderKitFactory rkFactory;
           private RenderKit lastRk;
           private String lastRkId;

           public RenderKit getRenderKit() {
               assertNotReleased();
               UIViewRoot vr = getViewRoot();
               if (vr == null)
                   return (null);
               String renderKitId = vr.getRenderKitId();
               if (renderKitId == null)
                   return null;
               if (renderKitId.equals(lastRkId))
                   return lastRk;
               else {
                   lastRk = rkFactory.getRenderKit(this, renderKitId);
                   lastRkId = renderKitId;
                   return lastRk;
               }
           }

      Ours is implemented a bit differently, which brings up questions of correctness. But, regardless, the key optimisation involves caching the last RenderKit, as well as the RenderKitFactory.

        Issue Links

          Activity

          Mark Collette created issue -
          Mark Collette made changes -
          Field Original Value New Value
          Link This issue blocks ICE-3082 [ ICE-3082 ]
          Ken Fyten made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Invalid [ 6 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Mark Collette
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: