Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
619859e
ci(pm-bench-phases): phase-isolated bench + standalone manifest-bench…
elrrrrrrr Apr 25, 2026
e190e41
chore(manifest-bench): tombi format + fix typo
elrrrrrrr Apr 25, 2026
b136dc0
chore(manifest-bench): tombi 0.7.32 format
elrrrrrrr Apr 25, 2026
6c64269
ci(pm-bench-phases): auto-trigger on (pm)-scoped PRs + sticky comment
elrrrrrrr Apr 25, 2026
a247a9b
ci(pm-bench-phases): cross-platform matrix + npmmirror run + revert l…
elrrrrrrr Apr 25, 2026
9ec1836
ci(pm-bench-phases): reuse pm-e2e's linux utoo build artifact
elrrrrrrr Apr 25, 2026
b383019
ci(pm-bench-phases): verify pm-e2e artifact exists before reuse
elrrrrrrr Apr 25, 2026
7a2e00a
ci(pm-build): consolidate pm-e2e + pm-bench + pm-bench-phases into on…
elrrrrrrr Apr 25, 2026
cdb1b51
feat(pm-bench-phases): add utoo@npm baseline column + render as markd…
elrrrrrrr Apr 26, 2026
3eb533c
fix(pm-build): point UTOO_NPM_BIN at node_modules/utoo/bin/utoo
elrrrrrrr Apr 26, 2026
b0a12f8
fix(pm-build): apply UTOO_NPM_BIN path fix to mac job too
elrrrrrrr Apr 26, 2026
993261d
refactor(bench): move bench scripts out of e2e/ into bench/
elrrrrrrr Apr 26, 2026
70f8df5
ci(pm): split pm-build into build-only + per-consumer workflows
elrrrrrrr Apr 26, 2026
469fb5d
Revert "ci(pm): split pm-build into build-only + per-consumer workflows"
elrrrrrrr Apr 26, 2026
a8c1e01
ci(pm): rename pm-build.yml → pm-e2e-bench.yml
elrrrrrrr Apr 26, 2026
f13a7a0
ci(pm): bench-phases now requires the `bench` PR label
elrrrrrrr Apr 26, 2026
386a7b4
ci(pm): swap bench triggers — phases on `benchmark` label, pm-bench d…
elrrrrrrr Apr 26, 2026
19fa69a
ci(pm): rename pm-bench → pm-bench-all (full PM shootout)
elrrrrrrr Apr 26, 2026
6f2bf0e
ci(pm): extract composite actions to dedup workflow steps
elrrrrrrr Apr 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/install-bench-tools/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: install-bench-tools
description: Install hyperfine + GNU time on the bench runner. macOS /usr/bin/time isn't GNU; install gnu-time and shadow `time` via $HOME/bin so bench scripts can use `time -v` regardless of platform.

inputs:
platform:
description: linux or mac
required: true

runs:
using: composite
steps:
- name: Install bench tools (linux)
if: inputs.platform == 'linux'
shell: bash
run: sudo apt-get update && sudo apt-get install -y hyperfine time
- name: Install bench tools (mac)
if: inputs.platform == 'mac'
shell: bash
run: |
brew install hyperfine gnu-time
mkdir -p "$HOME/bin"
ln -sf "$(brew --prefix gnu-time)/bin/gtime" "$HOME/bin/time"
echo "$HOME/bin" >> $GITHUB_PATH
16 changes: 16 additions & 0 deletions .github/actions/install-utoo-npm-baseline/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: install-utoo-npm-baseline
description: Install latest published `utoo` from npm into a temp directory and set $UTOO_NPM_BIN. Used by bench-phases jobs to add a published-version baseline column alongside the current-branch utoo. Installed locally (not -g) so it doesn't shadow $GITHUB_WORKSPACE/dist/utoo on PATH; npm's node_modules/.bin/ symlink isn't always populated for local installs, so we point at node_modules/utoo/bin/utoo (the package's `bin` field) directly.

runs:
using: composite
steps:
- name: Install utoo@npm baseline
shell: bash
run: |
mkdir -p /tmp/utoo-npm-pkg && cd /tmp/utoo-npm-pkg
npm init -y >/dev/null
npm install utoo --no-audit --no-fund --no-progress
UTOO_NPM_BIN="$PWD/node_modules/utoo/bin/utoo"
chmod +x "$UTOO_NPM_BIN"
"$UTOO_NPM_BIN" --version
echo "UTOO_NPM_BIN=$UTOO_NPM_BIN" >> $GITHUB_ENV
48 changes: 48 additions & 0 deletions .github/actions/post-bench-phases-comment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: post-bench-phases-comment
description: Render bench-phases output as markdown tables and upsert a sticky PR comment. The comment is keyed by header `pm-bench-phases-<platform>` so each platform's results live as a separate sticky comment, idempotent across commits.

inputs:
platform:
description: Platform name (linux / mac) — used in the comment header marker
required: true
os:
description: Runner OS string (ubuntu-latest / macos-latest) — shown in the comment title
required: true
github-token:
description: GitHub token for `gh` CLI lookups + sticky-comment posting
required: true

runs:
using: composite
steps:
- name: Build PR comment body
shell: bash
run: bash .github/scripts/render-bench-phases-comment.sh ${{ inputs.platform }} ${{ inputs.os }}
- name: Find Current PR
id: findPr
shell: bash
env:
GH_TOKEN: ${{ inputs.github-token }}
GH_REPO: ${{ github.repository }}
run: |
PR_NUMBER=""
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
PR_NUMBER="${{ github.event.pull_request.number }}"
else
PR_NUMBER=$(gh pr list --head "${{ github.ref_name }}" --state open --json number --jq '.[0].number' || true)
if [ -z "$PR_NUMBER" ] || [ "$PR_NUMBER" == "null" ]; then
PR_NUMBER=$(gh pr list --search "${{ github.sha }}" --state open --json number --jq '.[0].number' || true)
fi
fi
if [ -n "$PR_NUMBER" ] && [ "$PR_NUMBER" != "null" ]; then
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
fi
- name: Post PR Comment
if: steps.findPr.outputs.number
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pm-bench-phases-${{ inputs.platform }}
path: /tmp/pm-bench-output/pr_comment.md
number: ${{ steps.findPr.outputs.number }}
recreate: true
GITHUB_TOKEN: ${{ inputs.github-token }}
28 changes: 28 additions & 0 deletions .github/actions/setup-utoo-bin/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: setup-utoo-bin
description: Download a utoo artifact built by pm-e2e-bench's build-* job, install it on PATH, optionally create the `ut` symlink. Unix only — Windows e2e handles its own .exe layout inline.

inputs:
artifact:
description: Artifact name to download (e.g. utoo-linux-x64, utoo-mac-arm64)
required: true
with-ut-symlink:
description: Create `ut → utoo` symlink alongside the binary (e2e tests use both names; bench scripts don't).
required: false
default: 'true'

runs:
using: composite
steps:
- name: Download utoo binary
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact }}
path: dist
- name: Install utoo
shell: bash
run: |
chmod +x dist/utoo
if [ "${{ inputs.with-ut-symlink }}" = "true" ]; then
ln -sf utoo dist/ut
fi
echo "$GITHUB_WORKSPACE/dist" >> $GITHUB_PATH
118 changes: 118 additions & 0 deletions .github/scripts/render-bench-phases-comment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#!/usr/bin/env bash
# Render the pm-bench-phases sticky PR comment from per-registry log files
# in /tmp/pm-bench-output/. Called by pm-e2e-bench.yml's bench-phases-* jobs.
#
# Output: /tmp/pm-bench-output/pr_comment.md
#
# Args:
# $1 PLATFORM e.g. linux, mac
# $2 OS e.g. ubuntu-latest, macos-latest
#
# Each phase block in the bench output looks like:
#
# ## p0_full_cold
# PM wall ±σ user sys RSS pgMinor
# utoo 5.78s 0.12s 2.34s 1.23s 456M 12.3K
# bun 4.32s 0.08s 1.98s 0.87s 234M 8.5K
# PM vCtx iCtx net RX net TX cache node_mod lock
# utoo 45 12 234M 12K 450M 400M 3M
# bun 38 8 220M 11K 220M 400M 2M
#
# We emit one markdown subsection per phase containing two tables (timing
# and resource), one row per PM. Sticky-PR-comment dedup is upstream of
# this script — we just produce the body.
set -eu

PLATFORM="$1"
OS="$2"
OUT=/tmp/pm-bench-output/pr_comment.md
SHA="${GITHUB_SHA:0:7}"
RUN_URL="${GITHUB_SERVER_URL:-https://github.com}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"

mkdir -p /tmp/pm-bench-output
{
echo "## 📊 pm-bench-phases · \`$SHA\` · ${PLATFORM} (\`${OS}\`)"
echo ""
echo "[Workflow run]($RUN_URL) — ant-design"
echo ""
echo "_PMs: \`utoo\` (this branch) · \`utoo-npm\` (latest published) · \`bun\` (latest)_"
echo ""
} > "$OUT"

# Convert one log file's fixed-width tables into markdown.
render_log() {
local label="$1"
local file="$2"
if [ ! -f "$file" ]; then
echo "_${label}: no output captured._"
echo ""
return
fi

echo "### ${label}"
echo ""

# Strip ANSI colour codes so awk sees clean text.
local cleaned
cleaned=$(mktemp)
sed -E 's/\x1B\[[0-9;]*[a-zA-Z]//g' "$file" > "$cleaned"

awk '
function flush_table() {
if (n_rows == 0) return
# markdown header
printf "| "
for (i = 1; i <= n_cols; i++) printf "%s | ", header[i]
printf "\n|"
for (i = 1; i <= n_cols; i++) printf "---|"
printf "\n"
# data rows
for (r = 1; r <= n_rows; r++) {
printf "| "
for (i = 1; i <= n_cols; i++) printf "%s | ", rows[r, i]
printf "\n"
}
printf "\n"
n_rows = 0
n_cols = 0
}

/^## p[0-9]+_/ {
flush_table()
# phase heading (drop the leading `## `)
sub(/^## /, "", $0)
printf "#### %s\n\n", $0
in_phase = 1
next
}

in_phase && /^PM[ \t]+/ {
# New table header — flush any preceding one.
flush_table()
n_cols = NF
for (i = 1; i <= NF; i++) header[i] = $i
next
}

# Data rows: indented or pm-name-leading lines while a header is open.
in_phase && n_cols > 0 && NF == n_cols && $1 !~ /^(PM|##)$/ {
n_rows++
for (i = 1; i <= NF; i++) rows[n_rows, i] = $i
next
}

# End-of-phase marker: another `##` heading or blank-then-banner.
in_phase && /^##/ && !/^## p[0-9]+_/ {
flush_table()
in_phase = 0
next
}

END { flush_table() }
' "$cleaned"

rm -f "$cleaned"
}

render_log "npmjs.org" /tmp/pm-bench-output/bench-phases-npmjs.log >> "$OUT"
render_log "npmmirror.com" /tmp/pm-bench-output/bench-phases-npmmirror.log >> "$OUT"
Loading
Loading