From 995cb50c3050e97fe7a1e5a4d1a6763238e91a50 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Mon, 2 Mar 2015 13:23:09 +0000 Subject: [PATCH] Fix: The initalisation object was being cloned on init which could cause 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 --- js/core/core.constructor.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/core/core.constructor.js b/js/core/core.constructor.js index 05ed7ce20..bf4567c73 100644 --- a/js/core/core.constructor.js +++ b/js/core/core.constructor.js @@ -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