Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Maximum call stack size exceeded when adding a row to a huge spreadsheet with formulas #1332

Closed
sequba opened this issue Nov 8, 2023 · 1 comment · Fixed by #1321 or #1333
Closed
Assignees
Labels
Bug Something isn't working Impact: Medium Performance Issues related to the performance Released

Comments

@sequba
Copy link
Contributor

sequba commented Nov 8, 2023

Description

Code that produces this issue:

  it('handles huge spreadsheet', () => {
    const rowsCount = 1048576 // 2^20

    const sheet = []
    sheet.push(['1', '2', '3', '0', '0'])

    let prev = 1

    while (prev < rowsCount) {
      const rowToPush = [
        `${prev + 1}`,
        '2',
        '=3*5',
        `=A${prev}+D${prev}`,
        `=SUM($A$1:A${prev})`,
      ]

      sheet.push(rowToPush)
      ++prev
    }

    const engine = HyperFormula.buildFromArray(sheet, { maxRows: rowsCount*2 })

    expect(() => engine.addRows(0, [2000, 1])).not.toThrow()
  })

Originally reported by @BrianHung in #1321

image

HyperFormula version

2.6.0

Your environment

  • Node
  • Windows 11
  • 16 GB RAM
@sequba sequba added Bug Something isn't working Performance Issues related to the performance labels Nov 8, 2023
@sequba sequba self-assigned this Nov 8, 2023
@sequba sequba changed the title [Bug]: Out of memory when initializing HyperFormula with a 2^20-row sheet [Bug]: Maximum call stack exceeded when initializing HyperFormula with a 2^20-row sheet Nov 8, 2023
@sequba sequba changed the title [Bug]: Maximum call stack exceeded when initializing HyperFormula with a 2^20-row sheet [Bug]: Maximum call stack exceeded when adding row at the beginning of the huge spreadsheet Nov 8, 2023
@sequba sequba changed the title [Bug]: Maximum call stack exceeded when adding row at the beginning of the huge spreadsheet [Bug]: Maximum call stack exceeded when adding a row to the huge spreadsheet Nov 8, 2023
@sequba sequba changed the title [Bug]: Maximum call stack exceeded when adding a row to the huge spreadsheet [Bug]: Maximum call stack size exceeded when adding a row to the huge spreadsheet Nov 8, 2023
@sequba sequba changed the title [Bug]: Maximum call stack size exceeded when adding a row to the huge spreadsheet [Bug]: Maximum call stack size exceeded when adding a row to a huge spreadsheet with formulas Nov 8, 2023
@sequba sequba linked a pull request Nov 8, 2023 that will close this issue
13 tasks
@AMBudnik
Copy link
Contributor

Closed as solved and released in HyperFormula 2.6.1.
List of all the changes https://github.com/handsontable/hyperformula/releases/tag/2.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Impact: Medium Performance Issues related to the performance Released
Projects
None yet
2 participants