Extremely slow rendering after upgrading from DataTables 1.9.4 to 1.10.12

Extremely slow rendering after upgrading from DataTables 1.9.4 to 1.10.12

cre8tadreamcre8tadream Posts: 4Questions: 1Answers: 0

I am attempting to update an application from datatables 1.9.4 to version 1.10.12. The table is fairly large (30K rows). 1.9.4 renders it in approximately 6 seconds. When I switch the script (making no other changes) to point to 1.10.12 the table takes just shy of two minutes to render.

Obviously this doesn't work. I read the release notes. Did I miss something that I was suppose to do to my code when upgrading to the latest version? Any help will be appreciated.


Here is the script tags (the commented out version is 1.10.12) being called into a twig (symfony) page template.

   {# <script src="{{ asset('bower_components/datatables.net/js/jquery.dataTables.js') }}"></script> #}
    <script src="{{ asset('_assets/js/datatables.js') }}"></script>

And the call to make the datatable itself is below (this does not change):

        this.DataTable = $('#data-table').dataTable({
            bAutoWidth      : false,
            iDisplayLength  : 25,
            "sPaginationType"   : "full_numbers",
            sAjaxSource     : baseURL + 'data',
            aoColumns       : this.aoColumns,
            "deferRender": true
        });

And the html:

<table id="data-table" cellpadding="0" cellspacing="0" border="0" class="table table-striped dataTable" style='min-height: 150px'>
                <thead>
                <tr class='table-filters'>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                </tr>
                <tr>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                    <th>-</th>
                </tr>
                </thead>

            </table>

Answers

  • cre8tadreamcre8tadream Posts: 4Questions: 1Answers: 0

    Additional information: I profiled the running javascript with Chrome devtools. I have attached the top of the list which shows the places in the datatables script where the code is bogging down. Hopefully this helps one of you gurus to be discern what I am doing wrong. Thanks!

  • allanallan Posts: 63,818Questions: 1Answers: 10,517 Site admin

    Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.

    Information on how to create a test page, if you can't provide a link to your own page can be found here.

    Thanks,
    Allan

  • cre8tadreamcre8tadream Posts: 4Questions: 1Answers: 0

    Thanks Alan. Setting up the application on a external server is not possible. However, I did run your debug bookmark tool against the app. I was forced to cut the dataset down to 1000rows because with 36K rows, the bookmark code was unable to complete its task in an hours time. You can find the results of it run against 1K records here: https://debug.datatables.net/efecir

  • cre8tadreamcre8tadream Posts: 4Questions: 1Answers: 0

    Alan,

    If I remove columnFiltering the problem goes away. Are column filters applied differently in 1.10.x?

  • allanallan Posts: 63,818Questions: 1Answers: 10,517 Site admin

    I don't think the author of that plug-in ever updated it for 1.10.x. It should be backwards compatible, but if I recall correctly, that code uses some of the internal APIs which have changed (they shouldn't have been used externally).

    Check out YADCF which is actively maintained.

    Allan

This discussion has been closed.