Optimization Assistance

Optimization Assistance

rfitzwaterrfitzwater Posts: 57Questions: 5Answers: 1

All,

I am hoping the DataTables geniuses can help optimize my code. My a site is taking 5-10 seconds to load. My data is under 3000 rows and 30 columns. I know that enabling paging will increase my speed, but I wanted to keep the interface clean by using Scroller and not paging buttons that need to be clicked. If anyone can take a look at the code and provide suggestions/corrections, I would be greatly appreciative. I am also willing to pay for results as I just don't have time to figure all of this out myself.

https://ecr.rider.edu/ecrbeta/

Thank you,

-Rhon

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    This section of the FAQ should help, it discusses various techniques to improve performance,

    Cheers,

    Colin

  • rfitzwaterrfitzwater Posts: 57Questions: 5Answers: 1

    Colin,

    I've looked at that FAQ and implemented suggestions. deferRender is true and orderClasses is false. I am hoping someone can take look at the code (courseRoster.js) and let tell me if I'm doing anything obviously incorrect. Datatables works well with data sources that are much larger than mine. 30 columns and ~2000 rows shouldn't be this slow. Any help is appreciated.

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    It would be worth temporarily removing the initComplete function. You're initialise YADCF there, a third-party extension, so it would be interesting to see if the performance is affected by that, or just the standard DataTables initialisation,

    Colin

  • allanallan Posts: 63,213Questions: 1Answers: 10,415 Site admin

    Could you also remove displayBuffer: 15 //set to 15 please? It looks like it is including way more rows than it needs to which is seriously effecting the performance of Responsive (since it has to compute every row shown).

    There is no way to escape that fact that if performance is your main goal, then paging is the best option. But Scroller should help by reducing the number of rows that need to be calculated on. Certainly it is very slow at the moment and a trace shows that Responsive is one of the main time draws just now (might be worth disabling it just to check the difference).

    Allan

  • rfitzwaterrfitzwater Posts: 57Questions: 5Answers: 1

    I moved the YADCF out of initCompelete and it did give me slightly better results (~1second faster).

    The displayBuffer was is removed as well, but that doesn't seem to change anything.

    I also enabled caching and compression on the server side (via .htaccess) and that does seem to speed up returning visitors speed.

    Appreciate the assistance gents! Open to other suggestions as well if anyone else has thoughts.

    Thanks!

This discussion has been closed.