Skip to main content

Datatable performance with high number of columns

2 replies [Last post]
peltrie
Offline
Joined: 2006-12-30

Hi

I am having a performance problem with the yahoo datatable so I hope someone may be able to give me a few pointers as to what is going on and perhaps how I may be able to resolve the problem.

I have a datatable updated after a select type of event. The number of rows in a simple case is 12, however there are about 40 columns of data. The datatable has a hardcoded width to enable horizontal scrolling, its sorting code is disabled, and each column has an identifier and a field width specified. (Note, the code that calls addRows also performs a series of addDataset on a chart widget.)

Running under Firefox results in responses/screen refreshes of about 3 seconds, and IE (6+) responses are much longer, enough to start thinking something is wrong.

I do not know if it a browser issue, or it happens there is quite a bit of data coming through that must populate the table.

Has anyone experienced anything similar? and if so, were they able to resolve the issue? Any pointers will be helpful.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bakarirum
Offline
Joined: 2005-07-07

A couple of things.

The jMaki implementation uses JSON. (I am not sure if the Yahoo DataTable actually uses JSON directly or not and it is a little irrelevant to the point I am trying to make). IE has been known to be slower at processing JSON versus Firefox so you might see some performance issue there. However, you are only talking about 480 (12 rows X 40 columns) cells worth of information. In the scheme of processing, this should not be an issue. You might want to "profile" that page and see if you can find out where the bottleneck is. Make sure it is definitely the rendering of the page and not the server code.

I have a rather large internal application that I am developing now. I started using the Yahoo! DataTable model for all my "query/selection" data. The goal was to allow the users to query our customer database information and select the correct row and move to the next screen. I wanted the widgets on the page, due to the "easy" formatting they provide and also the sorting ability. As long as my queries return less than 200 rows of data (and in my test cases I returned at most 10 columns), the rendering of the table was acceptable. Once I hit the certain threshold (around 200 rows), the rendering was very slow and not acceptable for our needs. I am still using the widget for some of my application, but I am not really happy about this downside. Our mgmt is aware of this and they realize that if they happen to have a query that returns a lot of rows that the rendering might be slow (however, this care should be rare with our business logic). So in order to get around this, I created my own datamodel that has a sortable table (using JSP). The sorting, etc is performed in Java. I just throw my result information in a session variable and retrieve the information from the session variable and resort and redisplay the page. The performance is 100 times better than the Yahoo! DataTable. I can only assume that the degrading in performance is directly related to Yahoo! DataTable and not the jMaki implementation of it. However, I have never used Yahoo!'s DataTable directly so I have no comparison.

hth a little,

Marc

peltrie
Offline
Joined: 2006-12-30

Hi

Thanks for your comments and insight.

Was able to determine that the datatable itself performs extremely well for the number of items returned from queries. The problem was building the chart with the data: it looks that adding more than about five datasets to the chart starts to impede performance (the bottleneck looks like the render function).

P