Last Updated: 27 May 2020 11:01 by ADMIN
Bo Yuan
Created on: 19 May 2020 06:27
Category: Spreadsheet
Type: Bug Report
Decreased performance in the insertRow method

Bug report

Calling insertRow multiple times over many sheet data causes a slower performance since 2020.1.219.

Reproduction of the problem (2020.1.114)

  1. Click the Add Rows button and wait for the alert.

Current behavior

1 comment
Veselin Tsvetanov
Posted on: 27 May 2020 11:01

Hello Bo Yuan,

The decreased performance is caused by a fix for the following bug:

The performance hit is caused by the more complicated call to the Math.max() method (after the change it is called with three parameters instead of two). As there is no way to improve the performance of that native JS method, the performance hit could not be avoided.

As per the scenario in question, when a Sheet is DataSource bound, inserting new empty items (lines) is always better done on the DataSource itself instead of the Sheet. The following change will increase considerably the performance of the scenario in question:

$("#btn").on("click", function() {
  var newData = [];
  var date = new Date();

  var data = [];

  for (var i = 0; i < 50; i++) {
    var item = {};
    for (var c = 0; c < 100; c++) {
      item["col" + c] = null;

  alert((new Date() - date)/1000 + " seconds");
Here is a Dojo implementing the above scenario:

Veselin Tsvetanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.