Hide Random rows from large rows collection with perfomance

Posted by: viney.jindal on 23 November 2020, 10:15 pm EST

  • Posted 23 November 2020, 10:15 pm EST

    Hi,

    I am facing performance issue while hiding some random rows from large rows collection(approx. 5000 rows). I am using the following way out for each random row.
    instance.setRowVisible(row, value);

    I am able to achieve the functionality by looping through each row but its taking time (15 seconds and higher) if count of columns is less and it seems much higher time with large no. of columns.

    Could you please suggest any other way out (like hiding multiple random rows in one call to avoid the loop) to achieve this with better performance.

    Thanks,
    Viney Jindal
  • Replied 24 November 2020, 10:09 pm EST

    Hi Viney,

    We are unable to replicate the issue at our end. Please make sure you use the suspendPaint/resumePaint method before updating the visibility of rows. Please refer to the following code snippet and the attached sample demonstrates the same.
    if the issue persists please share a small sample that replicates the issue so that we could investigate and assist you accordingly.


    document.getElementById("hide").addEventListener("change", (e) => {
    sheet.suspendPaint();
    for (let i = 0; i < 5000; i++) {
    sheet.setRowVisible(i, !e.target.checked);
    }
    !e.target.checked && sheet.showRow(0);
    sheet.resumePaint();
    });


    sample: https://codesandbox.io/s/hungry-brattain-8rh0o?file=/src/index.js:342-601

    API References:
    Best Practice for improving performance: https://www.grapecity.com/spreadjs/docs/v14/online/BestPractices.html

    Regards
    Avinash
  • Replied 25 November 2020, 1:21 pm EST

    Hi Avinash,

    Thanks for the reply.
    I have attached the sample file on which I am working. In this file I am hiding rows which has zero value under some column. To accomplish this task it takes some extra time. Could you please try this sheet and provide the resolution.

    Facing some issue while attaching the file.
    I have uploaded it at following location -https://drive.google.com/file/d/1WX2CMFLdAv83XSBdWA4CEz--snW10MeY/view?usp=sharing
  • Replied 25 November 2020, 5:47 pm EST

    Attaching sample file for reference.

    sample.zip
  • Replied 26 November 2020, 5:28 pm EST

    Hi,

    Could you please reply with resolutioin.
  • Replied 30 November 2020, 9:00 pm EST

    Hi,

    Sorry for the late response but we are still no able to replicate the issue at our end. Please refer to the attached gif of our observation and let us know if we have missed any steps to replicate the issue. You may also check the sample that we used for testing.

    sample: https://codesandbox.io/s/spread-js-json-import-export-forked-2zs4q?file=/src/index.js

    API References:
    Best Practice for improving performance: https://www.grapecity.com/spreadjs/docs/v14/online/BestPractices.html

    Regards
    Avinash

    Regards
    Avinash

    ,
  • Replied 15 December 2020, 10:14 pm EST

    Hi Avinash,

    I tried to find out the difference and observe that we are using the spreadsheet and spread-excelio version 12.2.4. Due to some other issues currently we have not updated the latest one. so could you please try out once with 12.2.4 version to make sure whether the issue is because of version or something else.

    Thanks,
    Viney
  • Replied 16 December 2020, 9:41 pm EST

    Hi Avinash,

    One more thing whcih I noticed in the sample provided by you.
    Once I uploaded the sample template(same which has shared earlier in this thread) in following sample app provided by you :
    sample: https://codesandbox.io/s/spread-js-json-import-export-forked-2zs4q?file=/src/index.js

    Observe that grouping is taking 10-15 secs, however that is working fine (1 sec max) in our setup.
    Could you please look it out and suggest the solution.

    Thanks,
    Viney
  • Replied 19 December 2020, 7:37 pm EST

    HI Viney,

    We are sorry but we are still not able to replicate the issue at our end. We have tested the provided file in SJS V12.2.4 and on my machine(Window 10 64bit intel i5 10th generation 8GB Ram) I didn't feel any kind of delay. Could you please provide your sample that replicates the issue so that we could investigate further. You may also check the sample that we used for testing and the gif of our observation.

    sample: https://codesandbox.io/s/spread-js-json-import-export-forked-2zs4q?file=/src/index.js

    Regards
    Avinash
  • Replied 19 December 2020, 6:57 pm EST

    Hi Avinash,

    I had tried grouping performance issue in the sample provided by you.

    https://codesandbox.io/s/spread-js-json-import-export-forked-2zs4q?file=/src/index.js
    Attached is the video recorded for the same scenario. For a single row expand/collapse its working fine but grouping functionality takes bit time to complete on my machine(Window 10 64bit intel i5 16GB Ram))


    perfomanceissue.zip

    Rest we are investigating why hiding functionality taking bit time in our application and will get back to you shortly if required. (as in the sample provided by you its working fine without dealy)

    Thanks,
    Viney Jindal
  • Replied 20 December 2020, 6:19 pm EST

    Hi Viney,

    From the video, I could observe that the sample used was 14.0.2. it was a known issue in 14.0.2 which has fixed 14.0.4. Could you please try to replicate the issue it the latest 14.0.4 build here:

    https://www.grapecity.com/spreadjs/designer/
    Also if you are using the 12.2.4 there also, it should work fine. You could test the 12.2.4 sample here: https://codesandbox.io/s/spread-js-json-import-export-forked-2zs4q?file=/index.html

    Regards
    Avinash
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels