Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8DR#2
    • Fix Version/s: 1.8RC1, 1.8
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces

      Description

      BridgeFacesContext.getRenderKit() is called repeatedly in a single request and uses the factory each time. Performance could likely be improved through caching.

      (Diff also shows experimental timer utility.)

      --- src/com/icesoft/faces/context/BridgeFacesContext.java (revision 18259)
      +++ src/com/icesoft/faces/context/BridgeFacesContext.java (working copy)
      @@ -211,19 +211,25 @@
               return ((Vector) obj).iterator();
           }
       
      + RenderKit renderKit = null;
      +
           public RenderKit getRenderKit() {
      - UIViewRoot viewRoot = getViewRoot();
      - if (null == viewRoot) {
      - return (null);
      +long start = com.icesoft.faces.util.TimerUtil.start();
      + if (null != renderKit) {
      + UIViewRoot viewRoot = getViewRoot();
      + if (null == viewRoot) {
      + return (null);
      + }
      + String renderKitId = viewRoot.getRenderKitId();
      + if (null == renderKitId) {
      + return (null);
      + }
      +
      + RenderKitFactory renderKitFactory = (RenderKitFactory)
      + FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
      + renderKit = renderKitFactory.getRenderKit(this, renderKitId);
               }
      - String renderKitId = viewRoot.getRenderKitId();
      - if (null == renderKitId) {
      - return (null);
      - }
      -
      - RenderKitFactory renderKitFactory = (RenderKitFactory)
      - FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
      - RenderKit renderKit = renderKitFactory.getRenderKit(this, renderKitId);
      +com.icesoft.faces.util.TimerUtil.add("RKIT", start);
               return (renderKit);
           }

        Activity

        Hide
        Ted Goddard added a comment -

        Test for equality on renderKitId and use the factory if the id does not match the cached copy.

        Show
        Ted Goddard added a comment - Test for equality on renderKitId and use the factory if the id does not match the cached copy.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: