{"action":"opened","issue":{"url":"https://api.github.com/repos/DataTables/DataTables/issues/491","labels_url":"https://api.github.com/repos/DataTables/DataTables/issues/491/labels{/name}","comments_url":"https://api.github.com/repos/DataTables/DataTables/issues/491/comments","events_url":"https://api.github.com/repos/DataTables/DataTables/issues/491/events","html_url":"https://github.com/DataTables/DataTables/issues/491","id":56747412,"number":491,"title":"Drawing Child Rows on FF with *minified* JS 10x Slower than unminified JS","user":{"login":"Benno007","id":313195,"avatar_url":"https://avatars.githubusercontent.com/u/313195?v=3","gravatar_id":"","url":"https://api.github.com/users/Benno007","html_url":"https://github.com/Benno007","followers_url":"https://api.github.com/users/Benno007/followers","following_url":"https://api.github.com/users/Benno007/following{/other_user}","gists_url":"https://api.github.com/users/Benno007/gists{/gist_id}","starred_url":"https://api.github.com/users/Benno007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Benno007/subscriptions","organizations_url":"https://api.github.com/users/Benno007/orgs","repos_url":"https://api.github.com/users/Benno007/repos","events_url":"https://api.github.com/users/Benno007/events{/privacy}","received_events_url":"https://api.github.com/users/Benno007/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-05T23:35:48Z","updated_at":"2015-02-05T23:35:48Z","closed_at":null,"body":"I've just downloaded datatables to use in my local dev. The basic setup is just 6 columns, 30 rows, each with a child row that's appended on draw.dt (I need all these child rows to always display, instead of when clicking on a + to dropdown details).\r\n\r\nIn Firefox 35 (Chrome 40 is fine, IE10 appears fine), the minified version of your script is 10x slower on a draw with child rows than the unminified version.\r\nUnminified:\r\n![fast profile](https://cloud.githubusercontent.com/assets/313195/6071562/f2ee604c-ade2-11e4-8271-b08d4e8c2089.png)\r\nMinified:\r\n![slow profile](https://cloud.githubusercontent.com/assets/313195/6071563/f2ee6eac-ade2-11e4-9faf-3de4fe946edd.png)\r\n\r\nOpen these in Firefox with Firebug open and you should see the profile run\r\nJsFiddle with Minified JS: http://jsfiddle.net/w21gzbxe/1/\r\nJsFiddle with Unminified JS: http://jsfiddle.net/ddpL3cw3/\r\n\r\nThe offending function appears to be _Api.extend.\r\n\r\nI think it could be to do with either the way the minified version has its condition remapped, or how the for loop works and removes the braces. \r\n\r\nMy solution was to copy the unminified version, remap the variable names to their minified counterparts, and replace the function in the minified file, and it made it faster. But maybe there's something you can do in the code to fix it for the future.\r\n\r\nThis is the function as it is minified:\r\n```javascript\r\ns.extend=function(a,b,c){if(b&&(b instanceof s||b.__dt_wrapper)){var e,d,f,h=function(a,b,c){return function(){var e=b.apply(a,arguments);s.extend(e,e,c.methodExt);return e}};e=0;for(d=c.length;e<d;e++)f=c[e],b[f.name]=\"function\"===\r\ntypeof f.val?h(a,f.val,f):g.isPlainObject(f.val)?{}:f.val,b[f.name].__dt_wrapper=!0,s.extend(a,b[f.name],f.propExt)}};\r\n```\r\n\r\nThis is the function unminified:\r\n```javascript\r\n_Api.extend = function ( scope, obj, ext )\r\n\t{\r\n\t\t// Only extend API instances and static properties of the API\r\n\t\tif ( ! obj || ( ! (obj instanceof _Api) && ! obj.__dt_wrapper ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\r\n\t\tvar\r\n\t\t\ti, ien,\r\n\t\t\tj, jen,\r\n\t\t\tstruct, inner,\r\n\t\t\tmethodScoping = function ( scope, fn, struc ) {\r\n\t\t\t\treturn function () {\r\n\t\t\t\t\tvar ret = fn.apply( scope, arguments );\r\n\t\r\n\t\t\t\t\t// Method extension\r\n\t\t\t\t\t_Api.extend( ret, ret, struc.methodExt );\r\n\t\t\t\t\treturn ret;\r\n\t\t\t\t};\r\n\t\t\t};\r\n\t\r\n\t\tfor ( i=0, ien=ext.length ; i<ien ; i++ ) {\r\n\t\t\tstruct = ext[i];\r\n\t\r\n\t\t\t// Value\r\n\t\t\tobj[ struct.name ] = typeof struct.val === 'function' ?\r\n\t\t\t\tmethodScoping( scope, struct.val, struct ) :\r\n\t\t\t\t$.isPlainObject( struct.val ) ?\r\n\t\t\t\t\t{} :\r\n\t\t\t\t\tstruct.val;\r\n\t\r\n\t\t\tobj[ struct.name ].__dt_wrapper = true;\r\n\t\r\n\t\t\t// Property extension\r\n\t\t\t_Api.extend( scope, obj[ struct.name ], struct.propExt );\r\n\t\t}\r\n\t};\r\n```\r\n\r\nA further point, you could add the following to the start of the _Api,extend function, as it appears to not do anything if ext's length is 0 (as there are hundreds of calls where length is 0 in my setup):\r\n```javascript\r\nif(!ext.length) {\r\nreturn;\r\n}\r\n```"}}