Repository navigation
HF-150: advisory instruction-count workflow (prototype) #1814
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
Merged
marcin-kordas-hoc
merged 12 commits into
feat/hf-150-perf-gate
from
feat/hf-150-instruction-count
Nov 25, 2026
+108
−1
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
601548e
HF-150: sketch an advisory instruction-count workflow (work in progress)
marcin-kordas-hoc f99172e
HF-150: start the instruction-count runner through the generic tsnode…
marcin-kordas-hoc 34a38ef
HF-150: keep the base and head instruction counts sequential
marcin-kordas-hoc eba4939
Merge branch 'feat/hf-150-perf-gate' into feat/hf-150-instruction-count
marcin-kordas-hoc 30cf069
HF-150: point the instruction-count workflow at the engine package of…
marcin-kordas-hoc 46e220e
Merge branch 'feat/hf-150-perf-gate' into feat/hf-150-instruction-count
marcin-kordas-hoc 63b4b92
HF-150: mention the instruction-count workflow in the performance guide
marcin-kordas-hoc 7ded1cc
HF-150: skip the instruction count when the tests branch has no runner
marcin-kordas-hoc 5b27852
Merge branch 'feat/hf-150-perf-gate' into feat/hf-150-instruction-count
marcin-kordas-hoc 2f13c8b
Merge branch 'feat/hf-150-perf-gate' into feat/hf-150-instruction-count
marcin-kordas-hoc d0ac897
Merge branch 'feat/hf-150-perf-gate' into feat/hf-150-instruction-count
marcin-kordas-hoc ff3019a
HF-150: pin the instruction-count workflow to the actions performance…
marcin-kordas-hoc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| name: Performance (instruction count) | ||
| permissions: | ||
| contents: read | ||
|
|
||
| # Advisory companion of performance.yml. Instead of wall-clock time it counts the CPU instructions of each scenario's | ||
| # measured region with valgrind/callgrind, which does not depend on the load of the shared runner. The report goes to | ||
| # the job summary; nothing is posted to the pull request and the job never fails the pull request. | ||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
|
|
||
| jobs: | ||
| instruction-count: | ||
| name: Count instructions | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: true | ||
| timeout-minutes: 60 | ||
| steps: | ||
| # Counts depend on the exact Node.js build; base and head run in this job on the same one. | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | ||
| with: | ||
| node-version: '22' | ||
|
|
||
| - name: Install valgrind | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y --no-install-recommends valgrind | ||
| valgrind --version | ||
|
|
||
| - name: (base) Checkout main repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| ref: ${{ github.event.pull_request.base.sha }} | ||
| path: base | ||
|
|
||
| - name: (head) Checkout main repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| path: head | ||
|
|
||
| - name: Checkout hyperformula-tests repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| ssh-key: ${{ secrets.DEPLOY_TOKEN }} | ||
| repository: handsontable/hyperformula-tests | ||
| path: head/hyperformula/test/hyperformula-tests | ||
|
|
||
| - name: Fetch hyperformula-tests and sync branches | ||
| run: cd head/hyperformula/test && ./fetch-tests.sh | ||
|
|
||
| # Both sides run the same (head) copy of the suite; only the engine under test differs. | ||
| - name: Share the tests between base and head | ||
| run: cp -r head/hyperformula/test/hyperformula-tests base/hyperformula/test/hyperformula-tests | ||
|
|
||
| - name: Record the revisions under test | ||
| run: | | ||
| echo "base: $(git -C base rev-parse HEAD)" | ||
| echo "head: $(git -C head rev-parse HEAD)" | ||
| echo "tests: $(git -C head/hyperformula/test/hyperformula-tests rev-parse HEAD)" | ||
| node --version | ||
|
|
||
| - name: (base) Install dependencies | ||
| run: cd base && npm ci | ||
|
|
||
| - name: (head) Install dependencies | ||
| run: cd head && npm ci | ||
|
|
||
| # A tests branch that predates the runner skips the counts with a notice instead of failing. | ||
| - name: Check for the instruction-count runner | ||
| id: runner | ||
| run: | | ||
| if [ -f head/hyperformula/test/hyperformula-tests/performance/run-instructions.ts ]; then | ||
| echo "present=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "::notice::The paired hyperformula-tests branch predates the instruction-count runner; skipping." | ||
| fi | ||
|
|
||
| # The runner comes with the shared tests and is started through the generic tsnode script of the engine's | ||
| # package.json, which every revision has. Each run compiles the engine of its own tree into the same build directory and measures it | ||
| # there, so the two runs must stay sequential: the count depends on the paths a process sees. | ||
| - name: (base) Count instructions | ||
| if: steps.runner.outputs.present == 'true' | ||
| run: cd base && npm run tsnode --workspace=hyperformula test/hyperformula-tests/performance/run-instructions.ts "$GITHUB_WORKSPACE/base-instructions.json" | ||
|
|
||
| - name: (head) Count instructions | ||
| if: steps.runner.outputs.present == 'true' | ||
| run: cd head && npm run tsnode --workspace=hyperformula test/hyperformula-tests/performance/run-instructions.ts "$GITHUB_WORKSPACE/head-instructions.json" | ||
|
Tobiadefami marked this conversation as resolved.
Resolved
|
||
|
|
||
| - name: Compare the counts | ||
| if: steps.runner.outputs.present == 'true' | ||
| run: | | ||
| cd head && npm run tsnode --workspace=hyperformula test/hyperformula-tests/performance/compare-instructions.ts "$GITHUB_WORKSPACE/base-instructions.json" "$GITHUB_WORKSPACE/head-instructions.json" "$GITHUB_WORKSPACE/instructions-report.md" | ||
| cat "$GITHUB_WORKSPACE/instructions-report.md" >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| - name: Print the raw counts | ||
| if: always() | ||
| run: | | ||
| for f in base-instructions head-instructions; do | ||
| echo "::group::$f.json" | ||
| cat "$GITHUB_WORKSPACE/$f.json" 2>/dev/null || echo "(missing)" | ||
| echo | ||
| echo "::endgroup::" | ||
| done | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.