Slow rendering with Datatable.
Slow rendering with Datatable.
jerry98225
Posts: 10Questions: 0Answers: 0
Hi guys, I am trying to display a large amount of the data with datatabel (7000+ rows). The datatable itself is great. I love the functions and features. However, the page took 30+ sec to render. After the benchmark test, I suspect that the datatable default pagination feature is the reason that causes the problem. I don't want to disable it since it works so great. I was wondering if anyone has encountered the same issue before. Thanks for the help. :D
This discussion has been closed.
Replies
What is your data source for the table? DOM, Ajax?
Allan
Allan
I'm having this issue too now and 1.9 does nothing to solve it.
Not so long ago it would take a few seconds to run a table, but now anything with 3000+ rows drags.
My data is being returned in 2-3 secs (less than 0.0011 per 3 rows).
I can see the data appearing on screen very quickly. But when its being rendered by your script with the bells and whistles it can take up to 30secs.
I'm really not sure what has happened, and I've run all kinds of profiles, page speed tests (getting 98/100) e.t.c. It's purely the rendering. And as it's an intranet i can't give you a copy.
All i can say is upto about 3000 records it takes 2-3 seconds. after that can be 30-60 seconds
js/jquery-1.7.1.min.js line 2 (2 minutes 26 seconds)
Says something in line 2 of jquery minified is taking 2mins and 26 secs.
i removed all other scripts from the page aside from
jQuery
Datatables.js
tabletools.js
So something in line 2 is being called (I used the minified version of jquery from jquery.com) and causing this issue.
Might help you, as I don't know what you're calling in, in the main jQuery pot
Using JSON this can use DB queries to limit the return from the database to the first 25 records which are downloaded & rendered on the fly.
Regards,
Matt
Allan
And as of a few weeks ago it would load in seconds. Plus as i stated the data from server to browser is taking 2-3seconds.
I'll do a full jQuery and report back
Allan
No renderer options . . . and nothing has changed other than updating datatables!!
I've fulltext indexed my database to save some seconds.
"sSearch": "Search:",
},
"bJQueryUI": false,
"bSortClasses": false,
"aaSorting": [[1,'asc']],
"bInfo": true,
"bScrollInfinite": true,
"bScrollCollapse": true,
"sScrollY": "350px",
"iDisplayLength": 15,
"sDom": '<"H"Tfr>t<"F"ip>',
"oTableTools": {
"sSwfPath": base_url2 + 'swf/copy_cvs_xls_pdf.swf',
"aButtons": [
{
"sExtends": "pdf",
"sPdfOrientation": "landscape",
"sPdfMessage": "Barhale Training Centre"
},
{
"sExtends": "collection",
"sButtonText": "Save",
"aButtons": [ "csv", "xls", "copy" ]
}
]
}
http:///js/jquery-1.7.1.min.js (3 reflows)
The following JavaScript call stack caused a reflow that took 380 milliseconds: ba @ http:///js/jquery.dataTables.min.js:79:105 $ @ http:///js/jquery.dataTables.min.js:58:192 j @ http:///js/jquery.dataTables.min.js:127:128 jQuery.extend.each @ http:///js/jquery-1.7.1.min.js:658:20 jQuery.fn.jQuery.each @ http:///js/jquery-1.7.1.min.js:271:17
The following JavaScript call stack caused a reflow that took 350 milliseconds: @ http:///js/jquery-1.7.1.min.js:1487:84 @ http:///js/jquery-1.7.1.min.js:1615:3 @ http:///js/jquery-1.7.1.min.js:9266:3
The following JavaScript call stack caused a reflow that took 1 milliseconds: jQuery.each.jQuery.cssHooks.(anonymous function).get @ http:///js/jquery-1.7.1.min.js:6615:14 jQuery.extend.css @ http:///js/jquery-1.7.1.min.js:6578:48 jQuery.each.jQuery.fn.(anonymous function) @ http:///js/jquery-1.7.1.min.js:9191:23 a.ui.version.a.each.a.fn.(anonymous function) @ http:///js/jquery-ui-1.8.11.custom.min.js:9:2844 Ja @ http:///js/jquery.dataTables.min.js:70:341
http:///js/TableTools.js (1 reflows)
The following JavaScript call stack caused a reflow that took 14 milliseconds: ZeroClipboard.getDOMObjectPosition @ http:///js/TableTools.js:4:251 ZeroClipboard.Client.glue @ http:///js/TableTools.js:6:312 TableTools._fnFlashGlue @ http:///js/TableTools.js:54:58 TableTools._fnFlashGlue @ http:///js/TableTools.js:54:376
Long running scripts -
jquery-1.7.1.min.js line 921 (31 seconds 20 milliseconds)
jquery-1.7.1.min.js line 1 (14 seconds 254 milliseconds)