1 Reply Latest reply on Jul 8, 2010 5:30 AM by Milo van der Zee

    a4j:repeat performance

    Milo van der Zee Newbie

      Hello,

       

      I'm using a4j:repeat to dynamically create the columns of a table. I did some tests and found the following:

       

      RichFaces version      Dev system (t9600)    Prod system (q6600)

      3.3.1                           2ms/row                      2ms/row

      3.3.2/3.3.3                  2ms/row                      20ms/row

       

      So the a4j:repeat became much slower on my production system with the 3.3.2 and 3.3.3 versions of RichFaces. But the speed staid the same on my development system. Both systems have 4GB RAm and are running the same version of Tomcat. The application was deployed from the same WAR file on both systems.

       

      I find this very strange because what can be the differences? Does anybody have any idea where this difference could come from???

       

      Thank you very, very much for helping me.

       

      Milo

       

      Code piece:

      ...

                   <h:column>

                          <div><table id="rooms_#{var.rowIndex}"><tbody><tr>

                          <a4j:repeat id="columns" value="#{var.columns}" var="column" rowKeyVar="colIndex">

                              <td>

                                  <div>

                                      <div id="appointmentEmployee_#{var.rowIndex}_#{colIndex}"

       

                                           style="background: #{column.employeeDoesNotWork?'red' :

                                               (column.showEmployee2 ? (empty column.employee2.color?'transparent':column.employee2.color) :

                                                                       (empty column.employee1.color?'transparent':column.employee1.color))};

                                                   #{column.showEmployee2 ? 'border: 2px solid black; width: 20px; height: 11px;' : ''}"

                                      >

                                          #{column.showEmployee2 ? column.employee2.code : column.employee1.code}

                                          <h:panelGroup rendered="#{webSession.mode.editOrAdd and column.assigned}">

                                              <input id="assEmplBut_#{var.rowIndex}_#{colIndex}" type="button"

                                                  onclick="assignEmployee(event, #{calendarManager.selectedRoomGroup.id}, #{var.rowIndex}, #{colIndex},

                                                           #{column.showEmployee2 ? column.employee2.id : column.employee1.id}, 0);"/>

                                          </h:panelGroup>

                                          <h:panelGroup rendered="#{!empty column.employee1 and !empty column.employee2}">

                                              <div onmouseover="showToolTipSoon(this, '#{column.employee2.fullName}', 'smallToolTip');"/>

                                          </h:panelGroup>

                                      </div>

       

                                      <div

                                           style="background-color : #{empty column.appointment?'transparent':empty column.appointment.specialism?'ghostwhite':

                                                   column.appointment.specialism.color};"

                                      >

                                          <h:outputText rendered="#{column.appointment.description != null}"

                                              escape="false"

                                              value="#{column.firstLine and column.appointment.preferredVet!=null?

                                                      '&hearts; ':

                                                      ''}#{column.text}"

                                              onmouseover="showToolTipSoon(this,

                                                  '&lt;B&gt;#{column.appointment.customer} / #{column.appointment.animal}&lt;/B&gt; (#{column.appointment.id})&lt;BR/&gt;

                                                   #{column.appointment.specialism.description} / #{column.appointment.indication.description}&lt;HR/&gt;

                                                   #{column.encodedAppointmentDescription}');"

                                              style="#{column.appointment.endOfValidity != null ? 'padding-left: 14px;' : ''}

                                                     #{(column.preferredVetMismatch or column.appointmentWithoutEmployee) ? 'color: red;' : ''}"

                                          />

       

                                          <h:outputText rendered="#{column.appointment != null and column.appointment.description == null}"

                                              escape="false"

                                              value="#{column.text}"

                                              onmouseover="showToolTipSoon(this,

                                                  '&lt;B&gt;#{column.text}&lt;/B&gt;&lt;HR/&gt;

                                                   De bovenstaande gebruiker is voor deze periode een afspraak aan het maken.

                                                   Alleen als je zeker weet dat niemand met deze periode bezig is kan je deze

                                                   tijdelijke afspraak verwijderen.');"

                                          />

       

                                          <h:panelGroup rendered="#{webSession.mode.editOrAdd and !column.booked

                                                                  and !calendarManager.moveAppointmentState

                                                                  and !calendarManager.copyAppointmentState}"

                                          >

                                              <div id="mkAppBut_#{colIndex}_#{var.rowIndex}"

                                                  onclick="makeAppointment(event,#{var.rowIndex},#{colIndex}); return false;"

                                              />

                                          </h:panelGroup>

       

                                          <a4j:commandButton id="appointmentDestination"

                                              rendered="#{webSession.mode.editOrAdd and column.destinationAllowed and

                                                          (calendarManager.moveAppointmentState or calendarManager.copyAppointmentState)}"

                                              actionListener="#{calendarManager.appointmentDestination}"

                                              title="#{calendarManager.moveAppointmentState ? 'Verplaats' : 'Kopieer'} de afspraak hierheen"

                                              alt="#{calendarManager.moveAppointmentState ? 'Verplaats' : 'Kopieer'} de afspraak hierheen"

                                              immediate="true"

                                              reRender="calendarTimes"

                                              onclick="setAppState(appStates.INITIAL);"

                                          >

                                              <f:param name="roomId" value="#{column.room.id}"/>

                                          </a4j:commandButton>

       

                                          <h:graphicImage id="validitySet"

                                              rendered="#{column.appointment.endOfValidity != null}"

                                              url="/images/clock_h20px.png"

                                              styleClass="validityPeriodSet"

                                              alt="temporary"

                                          />

       

                                          <h:panelGroup rendered="#{webSession.mode.editOrAdd and column.firstLine and !column.extraRoomAppointment}">

                                              <a4j:commandButton id="copyAppointment"

                                                  rendered="#{column.appointment.description != null}"

                                                  image="/images/copy_h15px.png"

                                                  actionListener="#{calendarManager.copyAppointment}"

                                                  title="Kopieer een afspraak"

                                                  alt="Kopieer een afspraak"

                                                  immediate="true"

                                                  ajaxSingle="true"

                                                  bypassUpdates="true"

                                                  reRender="calendarTimes"

                                                  styleClass="appointmentCopy"

                                                  onclick="setAppState(appStates.INITIAL);"

                                              >

                                                  <f:param name="columnIndex" value="#{colIndex}"/>

                                              </a4j:commandButton>

       

                                              <a4j:commandButton id="moveAppointment"

                                                  rendered="#{column.appointment.description != null}"

                                                  image="/images/move_h20px.png"

                                                  actionListener="#{calendarManager.moveAppointment}"

                                                  title="Verplaats een afspraak"

                                                  alt="Verplaats een afspraak"

                                                  immediate="true"

                                                  ajaxSingle="true"

                                                  bypassUpdates="true"

                                                  reRender="calendarTimes"

                                                  styleClass="appointmentMove"

                                                  onclick="setAppState(appStates.INITIAL);"

                                              >

                                                  <f:param name="columnIndex" value="#{colIndex}"/>

                                              </a4j:commandButton>

       

                                              <a4j:commandButton id="editAppointment"

                                                  rendered="#{column.appointment.description != null}"

                                                  image="/images/edit_h20px.png"

                                                  actionListener="#{calendarManager.editAppointment}"

                                                  title="Bewerk een afspraak"

                                                  alt="Bewerk een afspraak"

                                                  immediate="true"

                                                  ajaxSingle="true"

                                                  bypassUpdates="true"

                                                  reRender="poll, createAppointmentForm, RoomDescription"

                                                  styleClass="appointmentEdit"

                                                  onclick="showModalPanel('createAppointmentPopup'); resetClickMarking();"

                                              >

                                                  <f:param name="appointmentId" value="#{column.appointment.id}"/>

                                              </a4j:commandButton>

       

                                              <a4j:commandButton id="deleteAppointment"

                                                  image="/images/delete_h20px.png"

                                                  actionListener="#{calendarManager.deleteAppointment}"

                                                  title="Wis een afspraak"

                                                  alt="Wis een afspraak"

                                                  immediate="true"

                                                  ajaxSingle="true"

                                                  bypassUpdates="true"

                                                  reRender="calendarTimes"

                                                  styleClass="appointmentDelete"

                                                  onclick="if(!confirm('Druk op OK om afspraak te wissen, druk op CANCEL om die niet te wissen...')) { return false; }"

                                              >

                                                  <f:param name="appointmentId" value="#{column.appointment.id}"/>

                                              </a4j:commandButton>

                                          </h:panelGroup>

                                      </div>

                                  </div>

                              </td>

                          </a4j:repeat>

                          </tr></tbody></table></div>

                      </h:column>

      ...