ICEfaces
  1. ICEfaces
  2. ICE-4555

Analyze performance implications of using ViewHandler.writeState call in FormRenderer

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha3
    • Fix Version/s: 2.0-Beta1, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      JSF 2.0

      Description

      Verify if calling ViewHandler.writeState repeatedly in renderers is causing a major slowdown.

        Activity

        Mircea Toma created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Salesforce Case []
        Fix Version/s 2.0-Beta [ 10231 ]
        Assignee Mircea Toma [ mircea.toma ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #21674 Mon Jun 07 06:59:35 MDT 2010 mircea.toma ICE-4555 Change form renderer to write the view state marker expected by com.sun.faces.application.view.WriteBehindStateWriter.
        Files Changed
        Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/FormRenderer.java
        Hide
        Mircea Toma added a comment -

        Changed form renderer to write the view state marker expected by com.sun.faces.application.view.WriteBehindStateWriter. WriteBehindStateWriter will call StateManager.getViewState only once and replace all the found markers in the page with the hidden input elements that carry the javax.faces.ViewState value.
        This fix avoids the component tree traversal for calculating state multiple times in case more than on form is found in the view.

        Show
        Mircea Toma added a comment - Changed form renderer to write the view state marker expected by com.sun.faces.application.view.WriteBehindStateWriter. WriteBehindStateWriter will call StateManager.getViewState only once and replace all the found markers in the page with the hidden input elements that carry the javax.faces.ViewState value. This fix avoids the component tree traversal for calculating state multiple times in case more than on form is found in the view.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ken Fyten added a comment -

        The commit for this change appears to be causing 3 regression test failures:

        ICE-3618 Fails (reset button not working)
        ICE-2614 Fails, application does not load properly, there are no yellow box to drop the dragable red square.
        ICE-2175 Fails, first click on any label does not select its corresponding radio button

        The Glimmer/compat tests for the above are located here: svn/repo/qa/trunk/Regression-Icefaces2/

        Show
        Ken Fyten added a comment - The commit for this change appears to be causing 3 regression test failures: ICE-3618 Fails (reset button not working) ICE-2614 Fails, application does not load properly, there are no yellow box to drop the dragable red square. ICE-2175 Fails, first click on any label does not select its corresponding radio button The Glimmer/compat tests for the above are located here: svn/repo/qa/trunk/Regression-Icefaces2/
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Priority P1
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #21727 Fri Jun 11 09:06:21 MDT 2010 mircea.toma ICE-4555 Make findComponentInView and findComponent methods work when component doesn't have an ID set (UIComponent.getId returns null).
        Files Changed
        Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/core/src/main/java/com/icesoft/util/CoreComponentUtils.java
        Hide
        Mircea Toma added a comment - - edited

        ICE-2614 test was failing because the dynamic components added to the body and head don't have IDs set. Previous to the ICE-4555 fix the call to StateManager.getViewState made by FormRenderer was forcing an early assignment of IDs (save/restore state is exercised which in turn calls UIComponent.getClientId methods which in turn generates IDs for the components that don't have it assigned yet). Since StateManager.getViewState is not called anymore CoreComponentUtil.findComponentInView was failing with a NullPointerException when using the null ID value of the component.
        Changed findComponentInView and findComponent methods to work with components that don't have the ID set (UIComponent.getId returns null).

        Show
        Mircea Toma added a comment - - edited ICE-2614 test was failing because the dynamic components added to the body and head don't have IDs set. Previous to the ICE-4555 fix the call to StateManager.getViewState made by FormRenderer was forcing an early assignment of IDs (save/restore state is exercised which in turn calls UIComponent.getClientId methods which in turn generates IDs for the components that don't have it assigned yet). Since StateManager.getViewState is not called anymore CoreComponentUtil.findComponentInView was failing with a NullPointerException when using the null ID value of the component. Changed findComponentInView and findComponent methods to work with components that don't have the ID set (UIComponent.getId returns null).
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #21742 Mon Jun 14 15:31:59 MDT 2010 mircea.toma ICE-4555 Write view state marker for any kind of request. Introduce protected method DOMPartialViewContext.getResponseOutputWriter. Override DOMPartialViewContext.getResponseOutputWriter in 'compat' to replace marker with hidden input element.
        Files Changed
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/DOMResponseWriter.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/DOMPartialViewContext.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/FormRenderer.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/core/src/main/java/com/icesoft/faces/context/CompatDOMPartialViewContext.java
        Hide
        Mircea Toma added a comment -

        Both ICE-3618 and ICE-2175 are failing because the initial fix for this issue generates a 'form' level update on first postback. This is due to input hidden element (holding the view state) inserted only for postbacks.

        As a fix ice:form renderer will write view state marker for any kind of request, postback or page load. This way the DOM diff process won't detect any differences anymore. For page loads the marker is replaced by JSF with the input element using its WriteBackStateWriter Introduce protected method. For poststbacks DOMPartialViewContext.getResponseOutputWriter returns a filter writer that replaces marker with hidden input element.

        Show
        Mircea Toma added a comment - Both ICE-3618 and ICE-2175 are failing because the initial fix for this issue generates a 'form' level update on first postback. This is due to input hidden element (holding the view state) inserted only for postbacks. As a fix ice:form renderer will write view state marker for any kind of request, postback or page load. This way the DOM diff process won't detect any differences anymore. For page loads the marker is replaced by JSF with the input element using its WriteBackStateWriter Introduce protected method. For poststbacks DOMPartialViewContext.getResponseOutputWriter returns a filter writer that replaces marker with hidden input element.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 2.0.0 [ 10230 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P1

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Mircea Toma
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: