ICEfaces
  1. ICEfaces
  2. ICE-4057

h: pass-through attribute rendering use attributesThatAreSet

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8RC1
    • Fix Version/s: 1.8RC1, 1.8
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      JSF Mojarra 1.2_05 and up

      Description

      This is a subset of ICE-3729, where we can make the h: components' pass-through attribute rendering take advantage of the attributesThatAreSet optimisation in JSF RI 1.2_05+.

        Issue Links

          Activity

          Hide
          Mark Collette added a comment -

          It was a pretty centralised change to the PassThruAttributeRenderer and PassThruAttributeWriter to support the attributesThatAreSet feature for h: components. And even though effects don't exist for h: components, LocalEffectEncoder was also updated to use the attributesThatAreSet List, for completeness.

          Basically, attributesThatAreSet is a List in UIComponent, accessible from UIComponentBase.getAttributes.get("javax.faces.component.UIComponentBase.attributesThatAreSet"), which is a List of all set attributes. This way, we don't have to iterate over all possible pass-through attributes, or effect attributes, for a component, but can instead iterate over the set attributes which are relevant to pass-through or effect rendering. Unfortunately, this feature only exists for stock components, and not third party components, even if they extend stock ones.

          Subversion 18311
          icefaces\core\src\com\icesoft\faces\context\effects\LocalEffectEncoder.java
          icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\DomBasicRenderer.java
          icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\PassThruAttributeRenderer.java
          icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\PassThruAttributeWriter.java
          icefaces\core\src\com\icesoft\faces\webapp\parser\ImplementationUtil.java

          Show
          Mark Collette added a comment - It was a pretty centralised change to the PassThruAttributeRenderer and PassThruAttributeWriter to support the attributesThatAreSet feature for h: components. And even though effects don't exist for h: components, LocalEffectEncoder was also updated to use the attributesThatAreSet List, for completeness. Basically, attributesThatAreSet is a List in UIComponent, accessible from UIComponentBase.getAttributes.get("javax.faces.component.UIComponentBase.attributesThatAreSet"), which is a List of all set attributes. This way, we don't have to iterate over all possible pass-through attributes, or effect attributes, for a component, but can instead iterate over the set attributes which are relevant to pass-through or effect rendering. Unfortunately, this feature only exists for stock components, and not third party components, even if they extend stock ones. Subversion 18311 icefaces\core\src\com\icesoft\faces\context\effects\LocalEffectEncoder.java icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\DomBasicRenderer.java icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\PassThruAttributeRenderer.java icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\PassThruAttributeWriter.java icefaces\core\src\com\icesoft\faces\webapp\parser\ImplementationUtil.java
          Hide
          Ted Goddard added a comment -

          Prior to the change, after 500 clicks on the auction monitor the time is:

          lifecycle took 12804000 RENDER: 11404000
          lifecycle took 12620000 RENDER: 11129000
          lifecycle took 13014000 RENDER: 11612000
          lifecycle took 12490000 RENDER: 11137000

          After the change (revision 18311):

          lifecycle took 12985000 RENDER: 11294000
          lifecycle took 12593000 RENDER: 11214000
          lifecycle took 12526000 RENDER: 11162000
          lifecycle took 12728000 RENDER: 11362000

          Further investigation is required. I will profile the updated code to see if the optimization is being applied as expected.

          Show
          Ted Goddard added a comment - Prior to the change, after 500 clicks on the auction monitor the time is: lifecycle took 12804000 RENDER: 11404000 lifecycle took 12620000 RENDER: 11129000 lifecycle took 13014000 RENDER: 11612000 lifecycle took 12490000 RENDER: 11137000 After the change (revision 18311): lifecycle took 12985000 RENDER: 11294000 lifecycle took 12593000 RENDER: 11214000 lifecycle took 12526000 RENDER: 11162000 lifecycle took 12728000 RENDER: 11362000 Further investigation is required. I will profile the updated code to see if the optimization is being applied as expected.
          Hide
          Ted Goddard added a comment -

          Using an h: component variation of the auctionMonitor test:

          lifecycle took 10690000 RENDER: 9391000
          lifecycle took 10140000 RENDER: 8889000
          lifecycle took 9987000 RENDER: 8797000
          lifecycle took 10683000 RENDER: 9504000

          After the change (revision 18311):

          lifecycle took 9686000 RENDER: 8435000
          lifecycle took 9514000 RENDER: 8344000
          lifecycle took 9629000 RENDER: 8462000
          lifecycle took 9473000 RENDER: 8282000

          Resulting in a measurable improvement.

          Show
          Ted Goddard added a comment - Using an h: component variation of the auctionMonitor test: lifecycle took 10690000 RENDER: 9391000 lifecycle took 10140000 RENDER: 8889000 lifecycle took 9987000 RENDER: 8797000 lifecycle took 10683000 RENDER: 9504000 After the change (revision 18311): lifecycle took 9686000 RENDER: 8435000 lifecycle took 9514000 RENDER: 8344000 lifecycle took 9629000 RENDER: 8462000 lifecycle took 9473000 RENDER: 8282000 Resulting in a measurable improvement.
          Hide
          Mark Collette added a comment -

          On average 7.7% less time for a lifecycle, and 8.4% less time for a render.

          Show
          Mark Collette added a comment - On average 7.7% less time for a lifecycle, and 8.4% less time for a render.
          Hide
          Ted Goddard added a comment -

          Running the test case again in the profiler and looking specifically at the ButtonRenderer showed a significant improvement. Rendering of the Button is now dominated by getResourceURL and renderBooleanAttributes. It is very important to apply this optimization across all ice: components.

          Show
          Ted Goddard added a comment - Running the test case again in the profiler and looking specifically at the ButtonRenderer showed a significant improvement. Rendering of the Button is now dominated by getResourceURL and renderBooleanAttributes. It is very important to apply this optimization across all ice: components.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: