Question about performance. Is this expected?
Question about performance. Is this expected?
Hi,
First of all Allan, thanks for making this great plugin. I moved away from the "FixedHeaderTable" I was using and migrated to Datatables. I am using it's Bootstrap integration and JQuery 1.11. I have a "small" table that I load via DOM and I am not sure if the performance I am seeing is the expected. I did read the FAQ and lots of threads. My table is around 15 columns and 100 rows. From what I read, this should be "small" enough for DOM load. The load of such table without Datatables takes 1sec approx. With Datatables it takes the double, 2sec. It is duplicating the time to load and I have not that many rows and columns. So I thought I may have something that could be improved.
I tried everything, deferRender true, orderClasses false, jQueryUI false, etc. The way I am using Datatables is:
$(document).ready(function() {
var oTable = $(''#', tableID asString ,''').dataTable( {
"scrollY": ( 0.7 * $(window).height() ),
"scrollX": "100%",
"scrollCollapse": true,
"paginate": false,
"stateSave": false,
"destroy": true,
"filter": false,
"sort": false,
"autoWidth": false,
"deferRender": true,
"orderClasses": false,
"jQueryUI": false,
"dom": "t",
"iDisplayLength": -1
} );
});
Changing my app to use AJAX load is a bit complicated, as well as providing a jsfiddle. However, maybe the above way I am using Datatables gives someone an idea. Note that right now I am not using any feature from datatable but the "fixed header" (scrollY). So I am disabling filtering, paginate, storting, etc...
I did some profiling and here you can see the results: http://tinypic.com/view.php?pic=oglv1k&s=8#.U7LANI1dWIc
Any idea? Thanks in advance,
Answers
Can you link to the page, as requested in the forum rules, so we can take a look please?
Allan
Hi Allan,
As said in my original post, it is hard to isolate the table I am building from the app. That's why I pasted the code I use for datatables to see if there is something easy at sight that I may try.
The only thing I see that would take additional time is the
$(window).height()
command since that will force a page layout in the rendering engine.Allan