Skip to content

Commit

Permalink
Fix: The initalisation object was being cloned on init which could ca…
Browse files Browse the repository at this point in the history
…use a major performance hit if you pass in a large data set into `dt-init data`. The table node and internal API reference also should not be cloned.

* Thank you to B Lyon for spotting this issue and writing it up:
  http://www.nowherenearithaca.com/2015/03/avoiding-performance-gotcha-with-jquery.html
  • Loading branch information
Allan Jardine committed Mar 2, 2015
1 parent f4d0880 commit 995cb50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/core/core.constructor.js
Expand Up @@ -75,13 +75,14 @@ if ( sId === null || sId === "" )

/* Create the settings object for this table and set some of the default parameters */
var oSettings = $.extend( true, {}, DataTable.models.oSettings, {
"nTable": this,
"oApi": _that.internal,
"oInit": oInit,
"sDestroyWidth": $this[0].style.width,
"sInstance": sId,
"sTableId": sId
} );
oSettings.nTable = this;
oSettings.oApi = _that.internal;
oSettings.oInit = oInit;

allSettings.push( oSettings );

// Need to add the instance after the instance after the settings object has been added
Expand Down

0 comments on commit 995cb50

Please sign in to comment.