Slow typing in Search box

Slow typing in Search box

dtuser18dtuser18 Posts: 1Questions: 1Answers: 0

Hello,
I have a table with 30 columns. No pagination, 860 rows.
Client-side or server side, I have the same issue.
Whenever I type something in the search box, even when using searchDelay, it takes one second to see the typed character.
Chrome show this:
Any idea why the Recalculate+Layout processes take so long?
Thanks!
PS: I do not have a link, it's on our intranet...

This question has accepted answers - jump to:

Answers

  • colincolin Posts: 4,630Questions: 0Answers: 814
    Answer ✓

    Hi @dtuser18 ,

    It will just be the time it takes to draw that number of rows. I tried it locally, see the attached file, and it's the same as you said with paging disabled - with paging on, the key presses are instantaneous. I suspect this will just be the sacrifice of having that number of visible rows on the screen.

    Cheers,

    Colin

  • allanallan Posts: 49,474Questions: 1Answers: 7,275 Site admin
    Answer ✓

    Just to expand on what Colin has said above, the search input action performed by DataTables is synchronous - so it appears that the browser is waiting for that to complete before drawing the new character into the search box (slightly surprised by that since it is listening on keyup, although I guess preventDefault() could still be used there).

    Its taking a certain amount of time (noticeable time) to perform the filter and then redraw the table with that many rows. If you search for "7" in Colin's example it takes a noticeable moment. Search for "B" and it is instant since there are no results.

    That's because its taking a while to render in all of the rows. The answer to this, and most performance issues with large tables, is to enable paging. It means the browser has a lot less work to do.

    Regards,
    Allan

Sign In or Register to comment.