Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7536611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:37:21+00:00 2026-05-30T06:37:21+00:00

I’m working on a page on a web app with a large table. 12

  • 0

I’m working on a page on a web app with a large table. 12 columns and up to 300 rows in some cases. I’m having difficulty getting the table to render quickly in Internet Explorer. I’ve replicated my difficulties in this bit of test code:

http://jsfiddle.net/dSFz5/

Some benchmarks with IE9 on an Intel Quad Core Q8200 with 4GB RAM:
50 rows, 12 columns: 432ms
100 rows, 12 columns: 1023ms
200 rows, 12 columns: 2701ms
400 rows, 12 columns: 8107ms
800 rows, 12 columns: 24619ms

Exponentially bad.

I managed to dig up some code that renders the same test table MUCH faster on Internet Explorer, but because I’m using mustache.js templates to render my cells and rows (keeping all HTML markup out of my JavaScript), I’m not able to use these DOM methods:

http://jsfiddle.net/bgzLG/

Benchmark results:
50 rows, 12 columns: 37ms
100 rows, 12 columns: 72ms
200 rows, 12 columns: 146ms
400 rows, 12 columns: 324ms
800 rows, 12 columns: 566ms

I can’t construct the table block by block like in the second example, because with client-side templates I need to inject strings of HTML returned by mustache. If you start sticking .innerHTML’s in there, the performance tanks again.

Can anyone recommend a way to build a table in a more efficient manner compliant with the use of client-side templates?

Pagination is one way to manage this issue, but I’d like to resolve the problem itself.

Any suggestions much appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:37:22+00:00Added an answer on May 30, 2026 at 6:37 am

    First, I would suggest separating out the creation of the strings from the actual creation of the table because it creates overhead in regards to rendering time. Next, you should try to create the whole table before appending it to the body to minimize the amounts of repaints/reflows. Finally, I would suggest joining an array in IE because string concatenation in that browser repeatedly allocates larger and larger memory blocks for each copy. When you use an array join, the browser only allocates enough memory to hold the entire string.

    var strings = [],
        table = ['<table>'],
        i, j;
    
    for (i = 0; i < 1000; i += 1) {
        strings[i] = [];
    
        for (j = 0; j < 12; j += 1) {
            strings[i][j] = randomString();
        }        
    }
    
    var start = new Date().getTime();
    
    for (i = 0; i < 1000; i += 1) {
        table.push('<tr>');
    
        for (j = 0; j < 12; j += 1) {
            table.push('<td>', strings[i][j], '</td>');
        }
    
        table.push('</tr>');
    }
    
    table.push('</table>');
    
    $('body').append(table.join(''));
    
    var end = new Date().getTime();
    var time = end - start;
    alert('Execution time: ' + time + 'ms');​
    

    Using this method, I get the following results in IE9:

    100 rows is ~9ms
    200 rows is ~19ms
    500 rows is ~51ms
    1000 rows is ~119ms
    5000 rows is ~526ms
    

    I’m sure we could optimize it further, but this should be plenty enough for up to 300 rows (~30ms), which is what you said your goal was. It also keeps it under the holy grail benchmark of under ~50ms for any UI interaction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am writing an app with both english and french support. The app requests

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.