Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-1410

insert a row takes an unexpected long time

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 3.9.5
    • None
    • Security Level: Jimmy

      Steps to Reproduce

      1. run the attached zul

      Current Result

      it takes over 60s to show the page

      Expected Result

      speed up the performance

      Debug Information

      • One cause: unnecessary cell change
        in FormulaTunerHelper.extendCellRef(),
        sheet3!E4
        the original formula: VLOOKUP(C4,sheet1!C:I,6,0)
        the formula after insertion: VLOOKUP(C4,sheet1!C$1:I$65537,6,0)
        The 2 formula are actually equivalent but their string are not equal (!fexpr.getFormulaString().equals(exprAfter.getFormulaString())) is false, it triggers cell change and calling getDependent() which takes a long time.
      • In FormulaEngineEx.adjustPtgs():
        Ptg[] tokens = org.zkoss.poi.ss.formula.Formula.create(fe.getPtgs()).getTokens();
        it only copies 2 bytes whose max value is 65535 (Excel97) but PtgShifter runs with EXCEL2007 which has larger max row. Such create() will reduce the max row to 65535

        1. t10526-sampling.png
          t10526-sampling.png
          148 kB
        2. Zss1410Composer.java
          0.8 kB
        3. zss-1410.xlsx
          98 kB
        4. t10526.zul
          0.4 kB

            Unassigned Unassigned
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: