Export to Excel very slow from version 1.10.17

Export to Excel very slow from version 1.10.17

fserafinfserafin Posts: 7Questions: 0Answers: 0

Hi,
I'm using datatables on a big amount of data, containig more than 6000 row, ~ 25 column each.
I was using it with dT version 1.10.16 and I wanted to upgrade the version to the last one 1.10.19.

I've noticed that the Export to Excel functionality is very very slower with the last version.
After trying several time switching versions, with the same dataset, I've got this results:

version <= 1.10.16 is very fast (~ 4 seconds)
verison >= 1.10.17 is very slow (> 30 seconds)

You can see here the difference:
version 1.10.16
version 1.10.17

Did some of you also noticed this behaviour?
thanks!!
frasurf

Replies

  • kthorngrenkthorngren Posts: 8,887Questions: 25Answers: 2,026
    edited July 2018

    Interesting, with Chrome on the Mac both take about 2 seconds but with Firefox the 1.10.17 test case takes much longer like you described.

    What browsers are you using that cause the problem?

    EDIT: Thanks for the test case!

    Kevin

  • fserafinfserafin Posts: 7Questions: 0Answers: 0

    I'm using Chrome 67.0.3396.99 on Mac 10.13.5. Result:
    1.10.16 ~ pretty immediate (half second maybe)
    1.10.17 ~ more than 2 seconds

    I tried just now Firefox 61 and.... result:
    1.10.16 ~ pretty immediate (less than 1 sec)
    1.10.17 ~ more than 30 seconds (a dialog asking you to stop the script appears)

  • fserafinfserafin Posts: 7Questions: 0Answers: 0

    I "kindly" used the test case from @colin in another post.

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    Its caused by this change. The .16 and earlier there was a bug whereby the cell selector modifier wouldn't be applied. It appears that fixing that unfortunately has introduced a performance regression.

    Allan

  • fserafinfserafin Posts: 7Questions: 0Answers: 0

    Thank you for your reply.
    I understand. Unfortunately this perfomance, especially with Firefox, makes the export for large dataset an issue. Would it be possible to "activate" the new behaviour only when {selected:true} is present?

    thanks again,
    fserafin

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    That would mean that DataTables core needs to have knowledge of the selector plug-ins, which isn't great for development. However, I do see this as an issue and it is something I will try to address.

    Allan

  • fserafinfserafin Posts: 7Questions: 0Answers: 0

    thank you very much!!

  • davidallen386davidallen386 Posts: 1Questions: 0Answers: 0

    Any update on this and fixing the performance problem? I am still seeing the same issue in version 1.10.19.

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    Not yet sorry. Its something I've yet to look at but will do before 1.10.20 release which I don't expect to be too far away - probably February.

    Allan

  • vismarkvismark Posts: 74Questions: 5Answers: 0

    Hi @allan
    is there any news about this issue? It takes almost 2 minutes to download a 6000 rows table, both in Chrome and Firefox. The browser even prompt for a restart as it thinks something freezed.

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    Hi - yes indeed I've committed a fix for this in the last few days and will be part of the next release. I forgot to push the change up, so the nightly won't be up-to-date yet, but will carry this change in the next 10 minutes.

    Allan

  • vismarkvismark Posts: 74Questions: 5Answers: 0

    Thanks @allan , the export is now super fast!

  • launchvlaunchv Posts: 1Questions: 0Answers: 0

    @allan Please let me know how to download this new version ?

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    There isn't a release version that carries this yet, but you can download the nightly until 1.10.20 is tagged and released.

    Allan

  • soseki_msoseki_m Posts: 7Questions: 1Answers: 0
    edited April 2019

    @allan Did you release the 1.10.20?
    Or, are you fixing other thing so you cannot release it?

    Also, if we care of performance then should we stay with 1.10.16?
    Or, nightly is faster?

  • colincolin Posts: 8,619Questions: 0Answers: 1,442

    Hi @soseki_m ,

    1.10.20 hasn't been released yet - it hasn't been fixed, but waiting for that release. There's no date yet, but it shouldn't be more than a few weeks. It would be worth using the nightly release if you can, it should be faster, but we'd welcome any feedback you have on the performance of nightly vs 1.10.16.

    Cheers,

    Colin

  • soseki_msoseki_m Posts: 7Questions: 1Answers: 0

    Hi @colin
    Thank you very much for quick reply.

    Okay, we might stay with nightly for now.

    Then, I am curious about how you improve the performance.

    Do you think you can tell me?

  • htomonhtomon Posts: 1Questions: 0Answers: 0

    When pressing download excel web-browser stays frozen, but
    I added an action function to show a loading spinner while document is being process.

    Timeout function finish when document is ready.

    dom: 'Bfrtip',
    buttons: [
    {
       extend: 'excel',
       text: '<i class="fas fa-file-excel fa-2x"></i> Excel',
       className: 'btn-outline-secondary text-success',
       init: function(api, node, config) {
          $(node).removeClass('btn-secondary')
       },
       action: function(e, dt, node, config) {
          var that = this;
          isLoading('Descargando excel'); // function to show a loading spin
    
          setTimeout(function() { // it will download and hide the loading spin when excel is ready
             exportExtension = 'Excel';
             $.fn.DataTable.ext.buttons.excelHtml5.action.call(that, e, dt, node, config);
             swal.close(); // close spin
          }, 1000);
    
       }
    },
    

    It works for me, hope it helps.

  • colincolin Posts: 8,619Questions: 0Answers: 1,442

    Nice, thanks for sharing.

  • tom99tom99 Posts: 31Questions: 5Answers: 0

    Any news regarding 1.10.20?

    Or is it possible to change some lines in 1.10.18 to get the speed back, even if that means losing some feature?

    I am a bit hesitant to use the nightly in production.

  • colincolin Posts: 8,619Questions: 0Answers: 1,442

    Hi @tom99 ,

    It should be in a couple of weeks. We aim to release a new CDN server next week, then a big release of DataTables and all extensions the following week.

    Cheers,

    Colin

  • tom99tom99 Posts: 31Questions: 5Answers: 0

    Thanks for the quick answer. Unfortunately, that is a bit long for us. We are exporting 10000 rows and this takes "forever".
    Any idea where I could patch something in DataTables to get the old behavior? I'd rather not go back to 1.10.16.

  • colincolin Posts: 8,619Questions: 0Answers: 1,442

    If you're going to patch, and the nightly releases work for you, I'd suggested just grabbing the current nightly and hosting it locally.

    C

  • tom99tom99 Posts: 31Questions: 5Answers: 0

    I have now basically reverted this commit in 1.10.18 and it is fast again:
    https://github.com/DataTables/DataTablesSrc/commit/1701640a4c245bef3cca1a7c0758a4cbb9add52d

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    The problem with reverting that commit is that it introduces a but on export with optional conditions (selected rows). That might effect how you are using it, but it is something we need to address.

    Have you tried the nightly? That should fix it.

    Allan

  • tom99tom99 Posts: 31Questions: 5Answers: 0

    Thanks for the pointer. I don't think the bug with the selected rows is a problem for us at the moment.

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    Did you try the nightly? It would be a great help to us if you could and report back on its performance, as we had a bit of a nightmare with that one.

    Allan

  • tom99tom99 Posts: 31Questions: 5Answers: 0

    Sorry for the delay.
    I used datatables.js, datatables.buttons.js and buttons.html5.js from nightly and the export time is about the same as 1.10.16, maybe a split-second slower.
    Exporting table with 12100 rows and 42 columns takes about 1 second with Chrome.
    Firefox takes about 2 seconds.
    So, everything is fine from my point of view.

  • colincolin Posts: 8,619Questions: 0Answers: 1,442

    Perfect, thanks for letting us know.

Sign In or Register to comment.