Datatables with huge data takes long time
Datatables with huge data takes long time
Srinivas-C
Posts: 4Questions: 1Answers: 0
I have around 50K data , got by running a sql query in python(data is in the form of list of tuples) .. which I rendered using for loop in Django template in table and then calling javascript datatable function for the created table to get its features applied to my table. But time taken to run the function is around 10-15sec. How can I reduce the time?
I am new to js.
Thanks in Advance
This question has accepted answers - jump to:
This discussion has been closed.
Answers
The place to start is to determine which process is taking a long time. Also take a look at this FAQ for Datatables specific ways to improve speed. There are third party Django libraries that are built to handle Datatables Server Side Processing. I haven't tried them so not sure how well they work.
Kevin
Hi kthorngren,
Thanks for the response
To brief the actual time taken for 50K data.. For rendering that data it is taking around 3seconds and for executing the datatable javascript function takes around 10seconds. So, some how can I reduce this 10seconds??
As that FAQ suggested, you could try
serverSide
,Colin
Hi Colin,
After rendering the data in template I can use the serverSide option in datatable javascript function or don't need to render the data in template?
Also, I tried giving '"orderClasses": false' parameter in function but no improve in performance..
Hi,
Sorry, I don't understand that. You can render client-side with
columns.render
when usingserverSide
- the server just sends the data, then the client can decide how to render it.Colin
Hi kthorngren, Colin,
Thanks for the help..
I went through the FAQ and also through the column.render option as mentioned above and now able to reduce the time for rendering from 15sec to 1.8sec...
Thank you