Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can be done to improve IE8 performance for large sets of data?

I have a page which displays ~300 pages worth of tabular data. Firefox, Chrome, Safari all work fine but IE 7, 8, and 8 Compatibility view all wretch. It lags for several seconds when I try to scroll or press the page up/page down button.

Pagination, smaller data sets, and other usability suggestions will not work for this page. Assume I absolutely have no choice but to display all this data at once... what are some things I can do to tweak it?

The data is being loaded via jQuery/Ajax and that seems to be at least in part suspect here, because when I created a test page to render the results directly it isn't quite as slow, but still not nearly as snappy as other browsers.

I've successfully used jQuery plugins such as SlickGrid to tackle similar problems in the past, but for reasons that would take a long time to explain they are not an option, even with the micro template rendering capabilities. I'm mainly concerned with what tweaks I can make to improve performance without reworking the entire page or introducing third party solutions.

Is a simplified DOM going to make a big difference? Or does IE not handle data brought in via JavaScript/Ajax well?

like image 338
aw crud Avatar asked May 24 '10 15:05

aw crud


1 Answers

Difficult to see without more details or an example... how are you building the content? There are quite a few little catches with building table content: in particular setting innerHTML directly on <table> doesn't work in IE, so jQuery's html() will probably be doing it a long, slow way round if that's what you're using.

But a general-purpose tip for anything with tables, especially larger ones: set the style table-layout: fixed on the <table> element, setting column width styles on either the first row of cells only, or on a set of <col>​s. (Columns without an explicit width will share the remaining width equally between them in a liquid layout situation.)

Since it does not depend on the quantity of content in each cell, fixed table layout is faster and much more predictable than the default auto table layout algorithm.

like image 117
bobince Avatar answered Sep 24 '22 14:09

bobince