Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82602

How to debug slow .columns.adjust()?

$
0
0

Hi. I haven't been able to make a minimal reproducible example, so far. The problem I'm facing is that calling table.columns.adjust() gets slow.

Observations

  1. Each next call is slower that the previous one.
  2. The more rows I have in the table, the slower it gets.

Measurements

I measured the time it takes for an adjust() call with different number of rows in the table. I called adjust() multiple times, not doing anything in between the calls. Each line is the time it takes for the next call.

10k rows
1) 15s
2) 50s

5k rows
1) 3s
2) 12s
3) 20s
4) 31s

1k rows
1) 0.1s
2) 0.4s
3) 0.7s
4) 1.3s
5) 1.6s
6) 1.9s
7) 2.2s
8) 2.7s

Datatable init

DataTable({
        select: {
            style: "multi+shift"
        },
        searching: true,
        scrollX: false,
        data: [],
        deferRender: true,
        processing: true,
        rowId: "uid",
        language: {
            url: "datatables_x.json"
        },
        pageLength: 50,
        lengthMenu: [10, 50, 100, 500],
        fixedHeader: true,
        dom: 'rt<"float-start clearfix"l>p',
        order: [[7, 'desc']],
        columnDefs: [
            {
                target: '_all',
                className: 'dt-center',
                orderSequence: ["desc", "asc"],
            }
        ],
        columns: [...]
})

Additional info

"datatables.net": "1.13.8"
Google Chrome

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.


Viewing all articles
Browse latest Browse all 82602

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>