How to time table loading?

How to time table loading?

lenamtllenamtl Posts: 265Questions: 65Answers: 1

Hi,

I'm looking for a snippet to time the table loading ..

using "deferRender": true, seems to take longer to load than "deferRender": false,

At the moment I'm timing the overall page load,
so I'd'like to use a snippet to get only the table load part to have a better precise result.

Thanks

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947
    Answer ✓

    Maybe this example will help:
    http://live.datatables.net/fomaqofu/1/edit

    Kevin

  • lenamtllenamtl Posts: 265Questions: 65Answers: 1

    Ok thanks a lot.

    with deferRender true DT init complete in 1532 milliseconds.
    with deferRender false DT init complete in 1649 milliseconds.

    The difference is not much is this worth to set it true ?
    I'm wondering if there are case that is not recommended to set to true and why?

    I mean why it is not set to true by default?

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947
    Answer ✓

    I have not used deferRender (except to see how it works) although I do have one page it may help on. If there is not much time difference I would guess your Datatable config is fairly simple, ie, not much going on with columns.render.

    There are situations where deferRender is not used such as DOM based data and it doesn't make sense to enable it with server side processing as that is only one page of data anyway.

    In the deferRender docs is this note as to why it probably isn't enabled by default:

    Note that when enabled, it goes without saying that not all nodes will always be available in the table, so when working with API methods such as columns().nodes() you must take this into account.

    You may be interested in this thread:
    https://datatables.net/forums/discussion/comment/136292/#Comment_136292

    Kevin

  • lenamtllenamtl Posts: 265Questions: 65Answers: 1

    Thanks for the information I really appreciate

This discussion has been closed.