
|
If you were logged in you would be able to see more operations.
|
|
|
|
When the list to display is average (in my case ~2000) and there is big content of <display:table> preformance is very poor: ~40 second to display 20 results out of 2000.
I dig out and now see the way to improve it.
Scenario
<display:table contains some logic + display:columnt tags:
<display:table id="oc" name="results" pagesize="${pagesize}"
requestURI="${request.contextPath}" sort="list" defaultsort="1">
<!-- some logic here about 20 logic tags - very needed -->
<logic:iterate id="attr" name="x" property="b">
.....
<display:column property="a"
....
/>
</display:table>
Obviously the display:table iterates its content through whole list - so all the tags are evaluated list.size() times. And it is very time consuming. doAfterBody called on TableTag in loop takes 38 seconds and real display of table (doEndTag) 2s in my case.
In fact it is enough to iterate the body of display:table ONCE, build the column structure and do the job in doEndTag. It will improve performance dramatically in such cases.
The only difference is that there cannot be any code inside which depends on the current row (for example getting the value from row and using it in anyway.
To keep compatibility, new flag can be added: evaluateBodyOnce [boolean] (or buildColumnStructureOnce) to switch from every-row-body-evaluation to one-time-body-evaluation.
(Now to improve performance a little bit, partialList can be used, but there is a lot of code to write addtionaly - to sort, to tract offset, etc).
|
|
Description
|
When the list to display is average (in my case ~2000) and there is big content of <display:table> preformance is very poor: ~40 second to display 20 results out of 2000.
I dig out and now see the way to improve it.
Scenario
<display:table contains some logic + display:columnt tags:
<display:table id="oc" name="results" pagesize="${pagesize}"
requestURI="${request.contextPath}" sort="list" defaultsort="1">
<!-- some logic here about 20 logic tags - very needed -->
<logic:iterate id="attr" name="x" property="b">
.....
<display:column property="a"
....
/>
</display:table>
Obviously the display:table iterates its content through whole list - so all the tags are evaluated list.size() times. And it is very time consuming. doAfterBody called on TableTag in loop takes 38 seconds and real display of table (doEndTag) 2s in my case.
In fact it is enough to iterate the body of display:table ONCE, build the column structure and do the job in doEndTag. It will improve performance dramatically in such cases.
The only difference is that there cannot be any code inside which depends on the current row (for example getting the value from row and using it in anyway.
To keep compatibility, new flag can be added: evaluateBodyOnce [boolean] (or buildColumnStructureOnce) to switch from every-row-body-evaluation to one-time-body-evaluation.
(Now to improve performance a little bit, partialList can be used, but there is a lot of code to write addtionaly - to sort, to tract offset, etc). |
Show » |
Sort Order:
made changes - 13/Jan/09 06:08 AM
| Field |
Original Value |
New Value |
|
Attachment
|
|
patch.txt
[ 39300
]
|
made changes - 30/Jan/09 08:43 AM
|
Attachment
|
patch.txt
[ 39300
]
|
|
|
The difference to the Tomasz' scenario is that my column logic does depend on the current row. However, it does not need to be executed each time when the list is re-displayed but only once. I also think that this is true for most use-cases when the whole list is kept in memory.
Thus, it would be nice to be able to evaluate the column logic once instead of every time the list is re-displayed.