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 8883401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:48:13+00:00 2026-06-14T20:48:13+00:00

Inspired by the comment on this question I put together a testcase . It’s

  • 0

Inspired by the comment on this question I put together a testcase.

It’s populating a table with 500 rows which takes about 15 seconds in Chrome 23 on my PC. Removing the Bootstrap CSS doesn’t exactly make it instant but improves the time significantly.

The actual code for adding the rows is:

$.each(response, function (idx, row) {
  var new_row = $('#row_template').clone();
  new_row.removeAttr('id');
  $('td[data-name=col1]', new_row).text(row.col1);
  $('td[data-name=col2]', new_row).text(row.col2);
  $('td[data-name=col3]', new_row).text(row.col3);
  $('td[data-name=col4]', new_row).text(row.col4);
  $('td[data-name=col5]', new_row).text(row.col5);
  $('td[data-name=col6]', new_row).text(row.col6);
  $('td[data-name=col7]', new_row).text(row.col7);
  $('td[data-name=col8]', new_row).text(row.col8);
  $('td[data-name=col9]', new_row).text(row.col9);
  $('td[data-name=col10]', new_row).text(row.col10);
  new_row.insertBefore($('#row_template')).show();
});

The abolutely lowest execution time I would probably get by concatenating HTML and getElementById().innerHTML, but can I do any other obvious optimizations while still maintaining some ease of use (especially getting the row from the template)?

  • 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-06-14T20:48:14+00:00Added an answer on June 14, 2026 at 8:48 pm

    It is only slow when you do it while the table is visible. If you hide it before and show it again after the changes it is quite fast:

    $('#results').hide();
    
    $.each(response, function (idx, row) {
      ...
    });
    
    $('#results').show();
    

    Check out my solution here: http://smartk8.no-ip.org/stackoverflow/13537578.htm

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

Sidebar

Related Questions

The following question is inspired by this blog entry at ajaxian.com and this comment
Inspired by Lance Pollard's comment in this question , something really weird happened and
G'day, Inspired by a comment I made in my answer to this question on
Inspired by this question How can I force GDB to disassemble? I wondered about
Inspired by this question which started out innocently but is turning into a major
Inspired by this question about Python caching small integers. Is it possible for the
Somewhat inspired by this question about a graphical programming environment. I don't think that
Inspired by this question , I'd like to know whether there is any trick
Inspired by the discussion in this question . We have all been taught that
Inspired by the encoding scheme of the answer to this question , I implemented

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.