Performance with many data

Performance with many data

veloopityveloopity Posts: 87Questions: 36Answers: 2

When I load 1000 or 5000 rows from a database table (on an older server which isn't extremely fast), after the rows are read I first see a table without pagination and datatables formatting - this is visible for a second or so, then after this the data are displayed the way they should be displayed.
Datatables needs a certain time to create the formatting (pagination, alternating row colors, search- and menu options, etc) - my impression is that the time this takes depends on the number of data rows, even though with pagination, only the first 10 rows get displayed, regardless of the total number. If this is true, I wonder if there is a way to make it display the paginated first 10 rows immediately while still formatting the other rows in the background. This would make for a smoother user experience.

-Michael

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951
    Answer ✓

    first see a table without pagination and datatables formatting - this is visible for a second or so

    Sounds like this delay is before Datatables starts initialization while the DOM table is built. You could hide the table then show it using initComplete

    If this is true, I wonder if there is a way to make it display the paginated first 10 rows immediately while still formatting the other rows in the background.

    You can use deferRender. This will render the rows when they are displayed. No background rendering.

    Kevin

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951
    Answer ✓

    This example shows a quick way for you to see how long it takes Datatalbes to initialize:
    http://live.datatables.net/fomaqofu/1/edit

    This may help you decide where the delay is.

    Kevin

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951
    Answer ✓

    Sorry, deferRender works with ajax or Javascript loaded data. see this FAQ for options to increase the speed.

    Kevin

Sign In or Register to comment.