Hang browser issue when using the search method

Posted by: qui.ha on 18 October 2024, 6:38 am EST

  • Posted 18 October 2024, 6:38 am EST - Updated 18 October 2024, 7:04 am EST

    The search method cause of hang browser issue when have too many rows/columns

     let spreadNS = GC.Spread.Sheets
          let condition = new spreadNS.Search.SearchCondition()
          condition.searchTarget = spreadNS.Search.SearchFoundFlags.cellTag
          condition.searchString = keyword
          condition.rowStart = beginRowIndex
          condition.columnStart = beginColumnIndex
          condition.searchOrder = spreadNS.Search.SearchOrder.zOrder
          let result = this.search(condition)

  • Posted 21 October 2024, 1:20 am EST

    Hi,

    Thanks for sharing the screenshot with us. In the screenshot, I could see the row count to be 16k and the column count to be 900k.

    When performing the cell searching, the search request with get the cell value, and checks if it matches the search condition or not, and SpreadJS will have to go through “16k * 900k” cells, and JavaScript being a single threaded will take a lot of time and the browser hangs. Currently, it seems like a limitation for performing search on such a large dataset.

    However, I have escalated this to the concerned dev team to check if there is a workaround for such cases. The internal tracking id for the issue is: SJS-26927. I will let you know when there is more information on this from the dev team.

    Currently, to optimize the performance, and if you have a small used range, you could use the “search” API on the worksheet instead of workbook. Refer to the following API: https://developer.mescius.com/spreadjs/api/classes/GC.Spread.Sheets.Worksheet#search

    Also, could you kindly confirm if there is a real use case for searching across such large number of cells?

    Regards,

    Ankit

Need extra support?

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

Learn More

Forum Channels