I noticed that with colReorder 1.7.0 lower performances compared to 1.5.4

I noticed that with colReorder 1.7.0 lower performances compared to 1.5.4

ufficio.fornitoriufficio.fornitori Posts: 11Questions: 1Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem: In a table with 92 columns the function table.colReorder.order(reOrderList, true); is extremely slow and compared with the ColReorder 1.5.4 the performances went from 9s to 15s

Answers

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    ColReorder 2 is just around the corner. If you could create a test case, when I merge it to master I'll try your test case with it.

    Allan

  • ufficio.fornitoriufficio.fornitori Posts: 11Questions: 1Answers: 0

    Is there any estimated date for this new release?

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Before the end of the month. I'm doing the merges today.

    Allan

  • ufficio.fornitoriufficio.fornitori Posts: 11Questions: 1Answers: 0

    Thank you for your fast support first of all!
    Secondly, would be possible to have a beta version after the merge to do some test?

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Yes, the nightly versions will contain the latest code.

    Allan

  • ufficio.fornitoriufficio.fornitori Posts: 11Questions: 1Answers: 0

    Hi Allan,

    I have prepared an example, and now you can test the problem.

    The link of example is
    * https://1726342.playcode.io/

    To replicate the problem:

    1 click on "layout" button

    2 click on "DRP depots" button

    if you want the source files :

    Thanks

    Best regards

  • ufficio.fornitoriufficio.fornitori Posts: 11Questions: 1Answers: 0

    Hi,
    Do you have a news?

    Thanks
    Best regards
    Gpa

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Is it possible to clone on playcode.io so I can modify it to try using the latest code? I couldn't see a way, and there is a ton of source code behind the page, that errors out if I try and use it on JSFiddle or similar. Perhaps you could create your test case on JSFiddle if you have the source (the link has expired).

    Thanks,
    Allan

  • ufficio.fornitoriufficio.fornitori Posts: 11Questions: 1Answers: 0
    edited January 29

    Hi,
    You can use this link to edit the source code.

    https://playcode.io/1726342

    If you want the source files :
    https://we.tl/t-aYUG01foGs (expiring in 7 days)

    Thanks
    Best regards
    Gpa

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Hi Gpa,

    Thank you - this is it with the nightly versions: https://playcode.io/1741733 .

    Its a bit better, but not as fast as I would like. I've been profiling it and the real slow down is column from the column sizing due to the use of scrolling in the DataTable. To make it faster, disable scrolling.

    Allan

  • ufficio.fornitoriufficio.fornitori Posts: 11Questions: 1Answers: 0

    Hi Allan
    Thanks for the reply but for our product it's not possible to disabled scrolling.

    Do you think this problem can be solved?
    If so when?

    Thanks
    Best regards
    Gpa

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    I'm not sure to be honest. Taking a profile of a column move, I can see that the delay is about 1S for me on my laptop. That consists of:

    • Fixed columns sizes
    • Row invalidation
    • Column resizing

    Each of them takes about 1/3 of a second. Row invalidation is the only one that can't be optionally disabled - that has to happen. So if you were to disable fixed columns and scrolling, that would significantly help performance, but you note that isn't an option.

    There will be performance improvements that can be made there, I'm just not immediately sure what. I am disappointed - I thought it was going to be faster, but DOM updates take time.

    Allan

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    What is really odd, is if I use ColReorder and FixedColumns on my own example: https://live.datatables.net/sugozeju/1/edit - its really quite fast.

    I don't really understand why your own would be so much slower!

    Allan

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    I think it is the number of columns. You have 90, and that means all DOM interactions are amplified - updating 90 cells in each row for example.

    Allan

  • ufficio.fornitoriufficio.fornitori Posts: 11Questions: 1Answers: 0

    Hi Allan,

    I have done a test page with the old version of components.

    This is the performance:
    1. UpdateLayoutColReorder start:2024-02-01T15:44:50.281Z
    2. UpdateLayoutColReorder end:2024-02-01T15:44:50.688Z

    I have 90 columns and the performance is very good.

    You can download the source files :
    https://we.tl/t-5wc4lR6NYO (expiring in 7 days)

    Thanks

    I'm waiting for your response.

    Best regards
    Gpa

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Thank you - yes the old version is faster because it doesn't do as many calculations to account for column alignment errors as the new version.

    I don't have an immediate solution to get back to the old performance I'm afraid.

    Allan

  • ufficio.fornitoriufficio.fornitori Posts: 11Questions: 1Answers: 0

    Hi Allan,
    Do you have a news?

    thanks
    Gpa

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    No - not at this time.

    Allan

  • ufficio.fornitoriufficio.fornitori Posts: 11Questions: 1Answers: 0

    Hi Allan,
    Do you have a news?

    thanks
    Gpa

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    No. I'd welcome a pull request with any performance improvements you or anyone else can find though. I haven't had a chance to look into this in detail.

    Allan

  • ufficio.fornitoriufficio.fornitori Posts: 11Questions: 1Answers: 0

    Hi Allan,
    I have a good news.

    If I remove or reduce the rows of datatables before calling the ColReorder function, the rendering time will be improved.
    Loading time increased from 20 seconds to 4 seconds.

    Thanks
    Gpa

Sign In or Register to comment.