reducing the number of calls that columns object makes
devonbl Mar 30, 2009 7:29 PMI'm trying to optimize my extendeddatatable code to speed up the load time for my page. during my profiling i discovered that the method that i pass into the "value" attribute of the columns object, gets called for every reference i have to its alias "column" in my code. This ends up being 1018 times. I tried outjecting via seam the field that my getColumns method returns, but its just ended me into a slew of scope problems, so i'm wondering if anyone out there has any idea how to reduce that call.
I've also tried using c:set, and a custom set taghandler, which makes the table not render at all.
Here's my html:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:service="http://connect.garmin.com/jsf/service"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:s="http://jboss.com/products/seam/taglib"
template="/api/activity-search/template/activitiesDefault.xhtml">
<ui:define name="content">
<h:form id="activitiesForm">
<rich:extendedDataTable id="activitiesGrid" value="#{activitiesListingDataModel}" var="row"
rows="20" style="height: 524px"
cellpadding="5" rowClasses="activityRow, activityRowAlternate"
onRowMouseOver="activitiesHandler.highlightRow(this)"
onRowMouseOut="activitiesHandler.unHighlightRow(this)">
<rich:columns id="#{column.fieldName}Column" value="#{activityListingDataProvider.columns}"
var="column" style="text-align:#{column.alignment};" label="#{column.columnHeader}"
rendered="#{column.fieldName != 'privacy'}">
<f:facet name="header">
<a4j:commandLink value="#{column.columnHeader}"
styleClass="ascSort"
reRender="activitiesGrid, counter"
title="#{column.unitOfMeasurement}">
<a4j:actionparam name="sortField" value="#{column.fieldName}" />
<a4j:actionparam name="sortWasClicked" value="true" />
</a4j:commandLink>
</f:facet>
<h:outputText value="#{row.cellMap.get(column.fieldName).displayValue}"/>
</rich:columns>
</rich:extendedDataTable>
<div class="activitiesToolBar left">
<a4j:commandButton id="setToEdit" value="refreshGrid"
action="#{activityListingDataProvider.setIsInEdit()}"
reRender="activitiesForm">
</a4j:commandButton>
</div>
<rich:panel id="counter" styleClass="counterPanel" rendered="#{not activityListingDataProvider.isInEdit}">
<div class="activitiesFooterLeft">
<rich:datascroller id="pageScroller" for="activitiesGrid" reRender="counter"
page="#{activityListingDataProvider.scrollerPage}"
align="center" maxPages="10" tableStyleClass="paginationTableStyle"/>
</div>
</rich:panel>
</h:form>
</ui:define>
</ui:composition>
any help appreciated
devon.lindsey@garmin.com