1 Reply Latest reply on Oct 19, 2009 4:12 AM by gonzalad

    ajax reRendering slow (page with big datatable)

    gonzalad

      Hello,

      I'm using 3.3.2.SR1 (but same behaviour with 3.3.0.GA).

      I have a page with 2 h:form :
      - one for search criterias (I use rich:simpleTogglePanel here)
      The simpleTogglePanel is in ajax mode.
      - the other for a rich:dataTable (20 columns, 100 rows, and rendered on each column).

      When I first expand the simpleTogglePanel (no rows displayed), the page is rendered in 200 ms.
      I submit now the search (100 rows displayed)
      Now, when I expand the simpleTogglePanel (with 100 rows displayed) it takes 5000 ms.

      My simpleTogglePanel reRenders only itself.

      What's my problem ?

      Thank you very much for your help

      P.S. also, this behaviour doesn't seem related to simpleTogglePanel only.
      It appears on every ajax call.

      A code extract from my page :

      <h:form id="sF">
       <rich:simpleTogglePanel id="mTp"
       ajaxSingle="true"
       switchType="ajax"
       label=" #{messages['recherche_avancee.tab.metier']}"
       style="cursor:hand;"
       opened="true"
       immediate="true"
       reRender="mTp">
       Content
       </rich:simpleTogglePanel>
      </h:form>
      
      <h:form id="dF">
      
       <rich:dataTable
       id="dDt"
       value="#{action.dataModel}"
       rows="#{action.pageSize}"
       rowClasses="rich-table-cell-impair, rich-table-cell-pair"
       var="element" width="800px">
      
       <a4j:support event="onRowDblClick" rendered="#{permissionAction.hasPermission(element)}"
       action="#{editerDocumentAction.setInstance(element)}"
       immediate="true"
       status="ajaxStatusMP" />
      
       <rich:componentControl event="onRowContextMenu" for="menu" rendered="#{permissionAction.hasPermission(element)}"
       operation="show">
       <f:param name="id" value="#{element.id}"/>
       </rich:componentControl>
      
       <rich:column styleClass="rich-table-cell-checkbox">
       <f:facet name="header">
       <h:outputText id="sc" value="0" />
       </f:facet>
       <h:selectBooleanCheckbox value="#{action.selectedItems[element]}"
       onclick="__colorTr(this, 'rich-table-row-over','ddF:dDt:sc','ddF:SearchInfoItemCheckedTop','ddF:SearchInfoItemCheckedBottom');"/>
       </rich:column>
      
       <rich:column
       rendered="#{nomVisible}"
       width="239px">
       <f:facet name="header">
       Sthing
       </f:facet>
       <a4j:outputPanel>
       <rich:dragSupport dragType="doc" dragValue="#{element}" rendered="#{draggable}"/>
       <h:outputText id="dti"
       converter="gedtitleconverter" value="#{element.name}"/>
       </a4j:outputPanel>
       </rich:column>
      
       <rich:column
       rendered="#{auteurVisible}">
       Same thing
       </rich:column>
      
       20 columns more...
       <rich:dataTable>
      </h:form>
      


      Also here my measures for rich:simpleTogglePanel expand when the list is not loaded :
      RESTORE_VIEW 1 view-id:/views/document/recherche_document.jspx 15 ms
      APPLY_REQUEST_VALUES 2 view-id:/views/document/recherche_document.jspx 0 ms
      RENDER_RESPONSE 6 view-id:/views/document/recherche_document.jspx 187 ms
      TOTAL_TIME view-id:/views/document/recherche_document.jspx 218 ms
      0.190524 ms 1 AbstractRechercherDocumentAction.getActiviteProduits()
      1.237793 ms 1 AbstractListAction.getDataModel()
      0.290377 ms 1 AbstractRechercherDocumentAction.getEntites()
       0.18874 ms 1 PermissionUtils.hasContributeurRole()
      0.165715 ms 1 AbstractRechercherDocumentAction.getTypes()
       0.16476 ms 1 AbstractListAction.isResultListNotEmpty()
      0.164333 ms 1 SearchSimpleTogglePanelBean.setIdentitySimpleTogglePanel()
      0.185757 ms 1 AbstractRechercherDocumentAction.getSources()
       0.23012 ms 1 AbstractRechercherDocumentAction.getCurrentSousTypes()
      0.326166 ms 2 ModalPanelAction.getModalPanelRendered()
      0.172281 ms 1 AdvSearchSelectOneBindingBean.setMetierSelectOneMenu()
      12.922218 ms 18 RechercherDocumentAction.getDocCriteria()
      0.339619 ms 1 PermissionUtils.hasAdminRole()
      0.162892 ms 1 AdvSearchSelectOneBindingBean.setSourceSelectOneMenu()
      0.165822 ms 1 AbstractRechercherDocumentAction.getMetierIGs()
      0.163427 ms 1 AdvSearchSelectOneBindingBean.setActiviteProduitSelectOneMenu()
      0.173073 ms 1 AdvSearchSelectOneBindingBean.setEntiteSelectOneMenu()
      0.174098 ms 1 AbstractRechercherDocumentAction.getLangues()
      0.163303 ms 1 AdvSearchSelectOneBindingBean.setLangueSelectOneMenu()
      


      And here with the list loaded (100 rows) :
      RESTORE_VIEW 1 view-id:/views/document/recherche_document.jspx 16 ms
      APPLY_REQUEST_VALUES 2 view-id:/views/document/recherche_document.jspx 0 ms
      RENDER_RESPONSE 6 view-id:/views/document/recherche_document.jspx 4968 ms
      TOTAL_TIME view-id:/views/document/recherche_document.jspx 5000 ms
      0.167171 ms 1 AbstractRechercherDocumentAction.getActiviteProduits()
      1.588733 ms 2 AbstractListAction.getDataModel()
      0.168221 ms 1 AbstractRechercherDocumentAction.getEntites()
      102.631175 ms 504 PermissionUtils.hasPermission()
      2.736667 ms 8 AbstractListAction.isPreviousExists()
      0.303314 ms 1 PermissionUtils.hasContributeurRole()
       0.16667 ms 1 AbstractRechercherDocumentAction.getTypes()
      3.479147 ms 17 AbstractListAction.isResultListNotEmpty()
      0.174401 ms 1 AbstractRechercherDocumentAction.getResultList()
       0.23383 ms 1 SearchSimpleTogglePanelBean.setIdentitySimpleTogglePanel()
      0.167281 ms 1 AbstractRechercherDocumentAction.getSources()
      0.176942 ms 1 AbstractRechercherDocumentAction.getCurrentSousTypes()
       1.36631 ms 6 ModalPanelAction.getModalPanelRendered()
      0.406744 ms 1 AdvSearchSelectOneBindingBean.setMetierSelectOneMenu()
      3.479231 ms 18 RechercherDocumentAction.getDocCriteria()
      4.659462 ms 2 AbstractRechercherDocumentAction.getPageSize()
      2.160107 ms 9 PermissionUtils.hasAdminRole()
      0.308434 ms 1 AdvSearchSelectOneBindingBean.setSourceSelectOneMenu()
      0.191742 ms 1 AbstractRechercherDocumentAction.getMetierIGs()
      0.273503 ms 1 AdvSearchSelectOneBindingBean.setActiviteProduitSelectOneMenu()
      0.404025 ms 2 PagedListAction.isNextExists()
      0.244924 ms 1 AdvSearchSelectOneBindingBean.setEntiteSelectOneMenu()
      0.167943 ms 1 AbstractRechercherDocumentAction.getLangues()
      0.257387 ms 1 AdvSearchSelectOneBindingBean.setLangueSelectOneMenu()
      


        • 1. Re: ajax reRendering slow (page with big datatable)
          gonzalad

          The solution to this problem is here :
          . http://www.jboss.org/index.html?module=bb&op=viewtopic&t=159201.
          . http://www.jboss.org/index.html?module=bb&op=viewtopic&t=154619
          . https://jira.jboss.org/jira/browse/RF-3341

          Just adding limitToList="true" to rich:simpleTogglePanel resolves my performance problem.

          Why render time is slow with big datatable evenif datatable is not reRendered ?
          -> Because each iteration component is cheked to see if it has ajaxRendered="true" childs.
          So, use limittolist="true"

          I have now :

          RESTORE_VIEW 1 view-id:/views/document/recherche_document.jspx 16 ms
          APPLY_REQUEST_VALUES 2 view-id:/views/document/recherche_document.jspx 0 ms
          RENDER_RESPONSE 6 view-id:/views/document/recherche_document.jspx 125 ms
          TOTAL_TIME view-id:/views/document/recherche_document.jspx 141 ms
          0.059053 ms 1 AbstractRechercherDocumentAction.getActiviteProduits()
          0.059316 ms 1 AbstractRechercherDocumentAction.getEntites()
          0.077441 ms 1 PermissionUtils.hasContributeurRole()
          0.065582 ms 1 AbstractRechercherDocumentAction.getTypes()
          0.111147 ms 1 SearchSimpleTogglePanelBean.setIdentitySimpleTogglePanel()
           0.05975 ms 1 AbstractRechercherDocumentAction.getSources()
          0.066484 ms 1 AbstractRechercherDocumentAction.getCurrentSousTypes()
          0.115004 ms 1 ModalPanelAction.getModalPanelRendered()
          0.124597 ms 1 AdvSearchSelectOneBindingBean.setMetierSelectOneMenu()
          1.230836 ms 18 RechercherDocumentAction.getDocCriteria()
          0.070406 ms 1 PermissionUtils.hasAdminRole()
          0.122955 ms 1 AdvSearchSelectOneBindingBean.setSourceSelectOneMenu()
          0.065875 ms 1 AbstractRechercherDocumentAction.getMetierIGs()
          0.113916 ms 1 AdvSearchSelectOneBindingBean.setActiviteProduitSelectOneMenu()
          0.112201 ms 1 AdvSearchSelectOneBindingBean.setEntiteSelectOneMenu()
          0.059464 ms 1 AbstractRechercherDocumentAction.getLangues()
          0.077556 ms 1 AdvSearchSelectOneBindingBean.setLangueSelectOneMenu()
          


          You can see now that PermissionUtils.hasPermission() isn't called anymore.