Skip to content

HF-150 (alternative): performance scenarios for cross-sheet references, volatile functions, undo/redo and spilled arrays - #1867

Draft
marcin-kordas-hoc wants to merge 2 commits into
feat/hf-150-perf-reportfrom
feat/hf-150-alt-more-scenarios
Draft

marcin-kordas-hoc wants to merge 2 commits into
feat/hf-150-perf-reportfrom
feat/hf-150-alt-more-scenarios

Conversation

@marcin-kordas-hoc

@marcin-kordas-hoc marcin-kordas-hoc commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Context

The PR adds performance scenarios for cross-sheet references, volatile functions, undo and redo, and spilled arrays, which the suite did not cover. It is an alternative for HF-150, stacked on #1852; whether it belongs in that task is open.

  • Why: a regression confined to one of these paths showed in neither measurement.
  • What changed:
    • Paired tests branch: six scenarios, in the wall-clock suite and the instruction count under the same names and sizes (table below).
    • hyperformula/dev-docs/PERFORMANCE.md: one sentence naming the scenario families the suite covers.
  • Result: the comment on every pull request reports the six scenarios on both sides.
  • Cost, measured in this PR's CI run: the six scenarios took 239 s of Test performance (+24% on the existing scenarios) and 230-234 s of callgrind processes per side in Count instructions (+24%). With 4 processes in parallel, that is about +2 min of that job. The last two runs on HF-150: one performance report per pull request, with the instruction count as the verdict #1852 took 15.1 and 17.6 min (Test performance) and 11.9 and 15.4 min (Count instructions).
Scenario Wall-clock median, local Instructions Callgrind process, local
Cross-sheet references - build 581 ms 2,688,394,979 41.8 s
Cross-sheet references - change value, add/remove row in the referenced sheet 238 ms 1,904,953,364 59.5 s
Volatile functions - 5 edits of an unrelated cell, 5k volatile cells 362 ms 1,439,024,078 51.6 s
Undo and redo - add/remove row/column and change value, undo 5, redo 3 556 ms 5,101,017,204 77.4 s
Spilled arrays - build 606 ms 2,786,779,514 42.6 s
Spilled arrays - one edit, 3k-cell spill 76 ms 572,522,457 47.8 s

What each scenario exercises is in the paired PR.

How did you test your changes?

  • Paired tests branch: feat/hf-150-alt-more-scenarios in hyperformula-tests (handsontable/hyperformula-tests#114, stacked on the tests branch of HF-150: one performance report per pull request, with the instruction count as the verdict #1852).
  • npm run test:jest -- unit/performance: 5 suites, 101 tests passed. npm run lint: 0 errors.
  • Validation controls: 7 runs of the real operations passed. 11 runs with an operation skipped or changed failed.
  • One local wall-clock round (PERF_SAMPLE_SCALE=0.5, as one of the four CI rounds), Node 22, shared 4-CPU machine: the six scenarios took 115.1 of 610.2 s. That is +23% on the existing scenarios; in the previous round it was +25%.
  • One callgrind process per scenario, locally: 320.7 s for the six. The same machine ran two existing scenarios in 0.83 of their CI time. With 4 processes in parallel, that is about +97 s per side.
  • CI on this PR (run 41013174798, tests 32649ba; the later tests commit d0f6462 changes one comment): the comment says "Executed instructions: no regression above +0.5% in 21 scenarios". All six new scenarios have base and head counts and base and head times. Wall-clock: 19 ok, 2 inconclusive (Sheet A: change value, add/remove row/column and Spilled arrays - one edit, 3k-cell spill). Test performance took 21.7 min, Count instructions 11.6 min.

Compatibility with Excel and Google Sheets

Not applicable.

Public API changes

None.

Out of scope and follow-ups

  • The volatile scenario's result does not show whether the volatile cells were recalculated; a change that skipped them would show only as a faster run.
  • The undo and redo scenario's result is the same whether or not the undo and redo of the row operations did anything. The column operations and the edit are checked.
  • The new scenarios have no noise history, so their wall-clock thresholds use the in-run rule.
  • Undo of a row removal grows faster than linearly with the sheet. On the 10k-row fan-out sheet, removing one row took 2-3 ms and undoing it 2.1-3.5 s. On 1k, 5k and 20k rows the undo took 0.1-0.23 s, 0.8-1.0 s and 21-38 s. Redo of a row removal on Sheet B grows the same way: 1.4-1.7 s at 5k rows, 42-48 s at 20k. These are local runs, three per size, on a loaded machine. The undo and redo scenario uses 1000 rows to stay within the CI time.
  • Spilled arrays - one edit, 3k-cell spill is too short for a stable wall-clock time. Its CI samples alternate between about 39 ms and 26 ms, so the median of a round flips between the two. Five edits in the region did not remove the alternation locally. Its instruction count is unaffected.
  • Ways to cut the added CI time: fewer wall-clock repetitions for the new scenarios, or dropping the two build scenarios.

Types of changes

  • Breaking change (existing functionality no longer works as before) – agreed with the maintainers
  • New feature or improvement (a non-breaking change that adds functionality)
  • Bug fix (a non-breaking change that fixes an issue)
  • Additional language file, or a change to an existing language file (translations)
  • Change to the documentation

Performance tests only, plus one sentence in dev-docs/.

Related issues

  1. HF-150 (internal task)

Checklist

🤖 Generated with Claude Code

The paired tests branch adds cross-sheet references, volatile functions,
undo and redo, and spilled arrays to both measurements; the sentence lists
them with the families that were already measured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
hyperformula-docs e9d239b Commit Preview URL

Branch Preview URL
Nov 03 2026, 07:10 AM

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Performance

✅ Executed instructions: no regression above +0.5% in 21 scenarios.
Wall-clock time (information only): ok: 21.

Scenario Executed instructions Verdict GC / compilation (information) Wall-clock Verdict (information)
Sheet A +0.000% ok +0.000% / 0.000% +0.19% ok
Sheet B -0.008% ok -0.000% / 0.000% -2.10% ok
Sheet T +0.006% ok 0.000% / 0.000% -2.19% ok
Column ranges +0.001% ok +0.000% / 0.000% -1.49% ok
Sorted lookup +0.000% ok +0.000% / 0.000% +0.91% ok
Sheet A: change value, add/remove row/column +0.002% ok -0.000% / 0.000% -0.44% ok
Sheet B: change value, add/remove row/column -0.000% ok -0.000% / 0.000% -0.26% ok
Column ranges - add column +0.002% ok -0.000% / 0.000% -0.21% ok
Column ranges - without batch +0.001% ok -0.000% / 0.000% +0.79% ok
Column ranges - batch +0.002% ok 0.000% / 0.000% -0.23% ok
Recalculation fan-out - one edit, 10k dependents +0.012% ok 0.000% / 0.000% +2.00% ok
Recalculation fan-out - 5 edits without batch -0.007% ok -0.000% / 0.000% -1.52% ok
Recalculation fan-out - 5 edits in batch +0.000% ok 0.000% / 0.000% -0.33% ok
Fan-out sheet - build, 30k rows +0.000% ok +0.000% / 0.000% - -
Recalculation fan-out - one edit, 30k dependents +0.001% ok -0.000% / 0.000% - -
Cross-sheet references - build +0.000% ok -0.000% / 0.000% +1.64% ok
Spilled arrays - build -0.010% ok 0.000% / 0.000% +2.28% ok
Cross-sheet references - change value, add/remove row in the referenced sheet +0.000% ok -0.000% / 0.000% -1.61% ok
Volatile functions - 5 edits of an unrelated cell, 5k volatile cells -0.000% ok +0.000% / 0.000% +1.70% ok
Undo and redo - add/remove row/column and change value, undo 5, redo 3 +0.000% ok -0.000% / 0.000% +0.55% ok
Spilled arrays - one edit, 3k-cell spill +0.000% ok 0.000% / 0.000% +6.16% ok
Fan-out sheet - build, 100k rows - - - +0.64% ok
Recalculation fan-out - one edit, 100k dependents - - - +0.24% ok

- in a whole column: the scenario is measured by one suite only. The instruction count runs the 100k-row scenarios at 30k rows, under names that say so.

Instruction counts

Instructions counted by callgrind in the measured region of each scenario. The verdict compares the executed instructions: the count without garbage collection and JIT compilation, whose share moves with the state of the heap and the compiler, not only with the code under test. A change larger than ±0.5% of the base is reported. GC, Compilation and Total give the change of those parts and of the whole count, in percent of the base count.

Scenario Base Head Change GC Compilation Total Verdict
Sheet A 4,705,818,336 4,705,824,975 +0.000% +0.000% 0.000% +0.000% ok
Sheet B 1,648,053,711 1,647,928,498 -0.008% -0.000% 0.000% -0.004% ok
Sheet T 1,510,460,352 1,510,552,032 +0.006% 0.000% 0.000% +0.004% ok
Column ranges 5,679,947,983 5,679,999,537 +0.001% +0.000% 0.000% +0.001% ok
Sorted lookup 4,968,942,335 4,968,942,912 +0.000% +0.000% 0.000% +0.000% ok
Sheet A: change value, add/remove row/column 1,067,431,196 1,067,447,760 +0.002% -0.000% 0.000% +0.001% ok
Sheet B: change value, add/remove row/column 1,333,126,587 1,333,125,470 -0.000% -0.000% 0.000% -0.000% ok
Column ranges - add column 1,661,026,089 1,661,060,553 +0.002% -0.000% 0.000% +0.002% ok
Column ranges - without batch 4,552,957,092 4,552,996,178 +0.001% -0.000% 0.000% +0.001% ok
Column ranges - batch 1,247,168,936 1,247,190,920 +0.002% 0.000% 0.000% +0.001% ok
Recalculation fan-out - one edit, 10k dependents 219,333,577 219,359,419 +0.012% 0.000% 0.000% +0.006% ok
Recalculation fan-out - 5 edits without batch 690,634,080 690,585,068 -0.007% -0.000% 0.000% -0.003% ok
Recalculation fan-out - 5 edits in batch 222,472,788 222,472,996 +0.000% 0.000% 0.000% +0.000% ok
Fan-out sheet - build, 30k rows 8,305,736,928 8,305,741,736 +0.000% +0.000% 0.000% +0.000% ok
Recalculation fan-out - one edit, 30k dependents 481,966,654 481,970,097 +0.001% -0.000% 0.000% +0.000% ok
Cross-sheet references - build 1,390,775,108 1,390,775,351 +0.000% -0.000% 0.000% +0.000% ok
Spilled arrays - build 1,367,909,026 1,367,766,226 -0.010% 0.000% 0.000% -0.005% ok
Cross-sheet references - change value, add/remove row in the referenced sheet 762,164,786 762,164,935 +0.000% -0.000% 0.000% +0.000% ok
Volatile functions - 5 edits of an unrelated cell, 5k volatile cells 927,538,806 927,537,258 -0.000% +0.000% 0.000% -0.000% ok
Undo and redo - add/remove row/column and change value, undo 5, redo 3 2,476,915,366 2,476,915,948 +0.000% -0.000% 0.000% +0.000% ok
Spilled arrays - one edit, 3k-cell spill 157,450,137 157,450,326 +0.000% 0.000% 0.000% +0.000% ok
Wall-clock times
Scenario base median (ms) head median (ms) change threshold noise (CV base/head) verdict
Sheet A 558.9 559.9 +0.19% ±5.0% † 1.9% / 2.2% ok
Sheet B 242.7 237.6 -2.10% ±7.4% † 3.9% / 3.1% ok
Sheet T 209.7 205.1 -2.19% ±8.0% † 4.2% / 2.3% ok
Column ranges 517.8 510.1 -1.49% ±5.3% † 2.2% / 2.8% ok
Sorted lookup 13342.2 13463.4 +0.91% ±50.0% ‡ 2.8% / 1.9% ok
Fan-out sheet - build, 100k rows 5794.8 5832.0 +0.64% ±50.0% ‡ 0.6% / 0.5% ok
Cross-sheet references - build 201.9 205.2 +1.64% ±5.0% 4.8% / 2.9% ok
Spilled arrays - build 196.1 200.6 +2.28% ±6.0% 4.2% / 7.7% ok
Sheet A: change value, add/remove row/column 147.0 146.4 -0.44% ±5.9% 6.3% / 5.8% ok
Sheet B: change value, add/remove row/column 209.4 208.9 -0.26% ±13.3% † 2.8% / 2.5% ok
Column ranges - add column 182.8 182.4 -0.21% ±6.4% † 2.1% / 3.9% ok
Column ranges - without batch 456.3 459.9 +0.79% ±6.3% † 2.6% / 4.3% ok
Column ranges - batch 152.2 151.8 -0.23% ±5.1% † 3.5% / 4.1% ok
Recalculation fan-out - one edit, 10k dependents 63.0 64.2 +2.00% ±6.4% † 8.2% / 6.0% ok
Recalculation fan-out - 5 edits without batch 132.6 130.6 -1.52% ±9.0% † 2.9% / 5.6% ok
Recalculation fan-out - 5 edits in batch 63.6 63.4 -0.33% ±6.8% † 3.9% / 4.9% ok
Recalculation fan-out - one edit, 100k dependents 330.7 331.5 +0.24% ±50.0% ‡ 12.0% / 15.1% ok
Cross-sheet references - change value, add/remove row in the referenced sheet 129.8 127.7 -1.61% ±5.0% 5.8% / 3.6% ok
Volatile functions - 5 edits of an unrelated cell, 5k volatile cells 205.4 208.8 +1.70% ±5.0% 1.9% / 3.7% ok
Undo and redo - add/remove row/column and change value, undo 5, redo 3 309.4 311.1 +0.55% ±5.9% 6.5% / 5.7% ok
Spilled arrays - one edit, 3k-cell spill 32.9 35.0 +6.16% ±35.3% 30.3% / 41.7% ok

Threshold of an unmarked scenario = max(5%, 3 x the standard error of the difference of the two medians). † = the band of changes observed on identical code in earlier runs, instead of that rule. ‡ = a fixed threshold for a scenario that guards against a change of complexity class. This check is advisory: it reports regressions but does not fail the build.

head e9d239bde · base 8869f4703 · tests c67810f53 · run

Executed instructions decide the verdict: they do not depend on the load of the runner. Garbage collection and JIT compilation are counted too but shown apart, in percent of the base count, because they move with the state of the heap and the compiler, not only with the code under test. Wall-clock times vary with the load of the runner and are shown for information. This report does not block merging.

…arios

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.28%. Comparing base (8869f47) to head (e9d239b).

Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                    @@
##           feat/hf-150-perf-report    #1867   +/-   ##
========================================================
  Coverage                    97.28%   97.28%           
========================================================
  Files                          207      207           
  Lines                        16218    16218           
  Branches                      3556     3556           
========================================================
  Hits                         15777    15777           
  Misses                         433      433           
  Partials                         8        8           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant