A: 

To get IE to respond quickly you should be creating your table rows as string representations of HTML , appending them to a string variable, and then adding the result to your table's like this.

myTable.myTbody.innerHTML = allThoseRowsAsAString;

It's not a memory issue: 5,000 rows should be trivial. That's got to be far less than one megabyte.

Robusto
Actually repeatedly appending to a string is not really a good idea in IE. (IE8 may be better than IE6 and 7 were.)
Pointy
If you want to avoid memory leaks, concatenating large strings is about the worst way to go about it.
Nick Craver
I'm just saying string concatenation is the fastest way to add lots of markup to a page, especially in IE. Read http://stackoverflow.com/questions/112158/javascript-string-concatenation thread, where the idea of string-concatenation-as-bottleneck is dismissed.
Robusto
IE8 has some bugs with innerHTML. when i try to do this, it gives me an error.
okie.floyd
i got the innerHTML to work, but it did not solve any of my memory issues. uncompressed, we are talking about roughly 1.5M of JSON data (apache gets it down to ~85k in the request). 1.5M of JSON is still causing a 100M spike in memory.
okie.floyd
Have you installed dynatrace and done some investigation into where the time is going?
Pointy
A: 

Robusto is right about innerHTML assignment being a better way to go. IE sucks at dynamic DOM creation

Why not form your innerHTML on the server using a jsp and stream it back via ajax in one shot. It will definitely speed things up, remove complexity from your javascript and delegate markup creation to its proper place.

plodder
i have tried forming the html on the server and sending it for insertion in one chunk, but granted i did not try it inserting it via innerHTML. i will try and let you know how it works (i am using php on the server side, btw).
okie.floyd
whoever gave the negative vote, would you please explain why?
plodder
twasnt me. i need all of the help i can get, and i certainly wouldnt ding someone for trying.
okie.floyd
A: 

As Plodder said, IE has big problems when working with DOM. jQuery best practices recommends creating code on a simple string and appending just once inside the container.

Beside this, I recently had a similar problem for a hierarchycal data, having an amount of 5,000 data records. I asked myself: did the user really need all that information available at a given moment? Then I realized the best I could do was just present a "first chunk of data" and then insert more data on user demand.

Finally, just one good tool: Dynatrace Ajax (it helps a lot to find the javascript function it takes more time to operate)

Esteve Camps
A: 

Since you are dealing with thousands of data rows I wouldn't call $('#my_table_tbody').empty() and add the new data with new DOM elements. Instead I'd follow the Object Pool Pattern. Thus instead of dropping all the tr's you can reuse existing ones and just populate with the new data.

If your new data set has less rows then the previous one, remove the rest of the rows from the DOM, but keep references to them in some pool so that garbage collector won't destroy them. If your new data set is bigger - just create new tr's on demand.

You can look at the implementation of YUI DataTable, here's the source. IIRC they use this approach to speed up the render time.

Ihor Kaharlichenko
+1  A: 
     var tmpText = [];
    for (k = mylength - 1; k >= 0; k--)
       {
          /* stack overflow wont let me type greater than & less than signs here, so just assume that they are there. */
    tmpText.push('anything you want')
          tmpText.push( 'tr class="' + j[k].row_class . '"   td class="col1_class" ' + j[k].col1 + ' /td td class="col2_class" ' + j[k].col2 + ' /td  td class="col3_class" ' + j[k].col3 + ' /td /tr';)
       }
    $('#main_area').html(tmpText.join(''))

    }

you dont need document.getElementById('main_area').innerHTML = '';

this method is to push into array, then join and use jquery html function to update. This is the fastest method I know. Sorry for the format here - its my first post and I thought I'd give something back here to stackoverflow.

Richard
yup.. typical immutable strings thing,
Ravindra Sane
A: 

Do you get the same problem if you use another element than tables? Like divs or something.

No idea if it will work but might be worth a try.

Rabarber