Ensuring High Performance

To achieve the best recalculation performance for very large worksheets (millions of cells, large numbers of formulas), follow these guidelines:

  1. Avoid formulas that return arrays, such as:
    =b10:d2000000 * 5 + 1
    These prevent GS-Calc from fully utilizing multicore calculations.
  2. Avoid using arrays for intermediate results, such as:
    =match(v, b10:d2000000 <> 1, 0)
    Instead, fill helper columns (e.g., e10:g2000000) with:
    =b10 <> 1, =c10 <> 1, etc., then use:
    =match(v, e10:e2000000, 0)
    This makes a dramatic difference when thousands of match() formulas are present.
  3. The rand() function is single‑threaded. If used heavily in large worksheets, it forces other cores to wait. For large random datasets, generate static random values using Insert > Random Data to allow multicore execution.
  4. Ensure GS-Calc is allowed to use the maximum number of threads/cores via:
    Settings > Options > Calculation
    or per‑workbook overrides in:
    Tools > Update Options
  5. If using vlookup() or match() on large datasets, choose one of the following:
    • Use the default:
      Tools > Update Options > VLOOKUP and MATCH mode > Fast with binary searches
      GS-Calc performs internal background sorting during the first update, then maintains sorted indices. First update may be slower; subsequent updates are dramatically faster.
      Note: Regular expressions cannot be used in binary search mode.
    • Use extended versions of these functions with explicit binary‑search parameters.

    Binary search reduces lookup steps from N/2 to log₂(N). For 10 million rows, this is over 200,000× fewer steps.

  6. sumIf() and countIf() automatically use fast binary searching for column ranges with ≥16384 rows. You can adjust this threshold in settings.xml by modifying if-calc-treshold.

    Typical location:

    C:\Users\your-name\AppData\Local\GS-Calc

    In portable setups, the file resides in the chosen installation folder.

  7. Deleting very large blocks of cells does not immediately free memory — the deleted data remains in the Undo buffer. Memory is released when the buffer cycles or when you manually reset it. Undo level is configured in Settings > Options.
  8. When using Edit > Find/Replace on extremely large tables (hundreds of millions of cells), you may switch between:
    • regular expression mode
    • plain text partial/full matching
    depending on speed vs functionality. Even very large searches typically complete within seconds.