how to reduce processing time in datatables?

how to reduce processing time in datatables?

Periyasamy25Periyasamy25 Posts: 13Questions: 0Answers: 0
edited March 2014 in General
i am using datatables in my php ajax coding.i am using search to display datas.To display less than 1000 datas datatables takes fraction of seconds.But more than 5000 datas it takes more than a minute.So how to reduce this display time in datatables for more than 1000000 datas.

My datatables coding is

$('#example').dataTable(
{
"bProcessing": true,
"bJQueryUI": true,
"oLanguage": {
"sSearch": ' Search Datas:',
"sLengthMenu": "Display _MENU_ profiles",
"sInfo": "Showing _START_ to _END_ of _TOTAL_ profiles",
"sInfoEmpty": "Showing 0 to 0 of _TOTAL_ profiles",
"sInfoFiltered": "(filtered from _MAX_ total profiles)",
"sZeroRecords": "No profiles available in table",
},
"aLengthMenu": [[10, 25, 50, 100, 200, 300], [10, 25, 50, 100, 200, 300]],
"sDom": 'lf rr pi <"toolbar">rt pi',
"fnDrawCallback": function () {
start=this.fnPagingInfo().iStart+1;
end=this.fnPagingInfo().iEnd;
},
});

Replies

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    See the FAQs: http://datatables.net/faqs#speed .

    Allan
  • Periyasamy25Periyasamy25 Posts: 13Questions: 0Answers: 0
    There is no difference after adding "bDeferRender": true in my code.It takes same processing time to display the table.
  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    You aren't using Ajax loading, so no, deferred rendering wouldn't make any difference, since everything has already been rendered.

    Use Ajax loading for a speed increase, as the FAQ suggests.

    Allan
  • Periyasamy25Periyasamy25 Posts: 13Questions: 0Answers: 0
    I need a complete example for Ajax loading.i.e html,php and ajax coding with datatables.
  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    An example is right here: http://datatables.net/release-datatables/examples/ajax/ajax.html
  • Periyasamy25Periyasamy25 Posts: 13Questions: 0Answers: 0
    I am displaying the table content based on the search parameters(dynamic based on the query).How to use ajax loading for dynamic table?
  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    If you are sending the extra data for the search as part of the DataTables Ajax request, then you could use `ajax.reload()` in 1.10 or the fnReloadAjax plug-in in 1.9-.

    Allan
  • Periyasamy25Periyasamy25 Posts: 13Questions: 0Answers: 0
    edited March 2014
    I mean that How to use server-side processing for dynamic table?
  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    I don't really understand. There is a server-side processing example here: http://datatables.net/release-datatables/examples/server_side/server_side.html
This discussion has been closed.