Skip to content

Commit 3f0f21d

Browse files
committed
Bench run: fix1 type-validation, main vs eng-10093
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G8cXh3TUbNtbjm2ERqE62X
1 parent da147c0 commit 3f0f21d

2 files changed

Lines changed: 44 additions & 40 deletions

File tree

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
# Temporary benchmark harness used to collect before/after numbers for the
22
# framework performance PRs. Lives only on a scratch branch; never merged.
3+
# Triggered by pushing to the scratch branch; parameters come from
4+
# benchmarks_scratch/run.json ({"base_ref", "head_ref", "bench_script"}).
35
name: claude-perf-bench
46

57
on:
6-
workflow_dispatch:
7-
inputs:
8-
base_ref:
9-
description: Baseline ref to benchmark
10-
required: true
11-
default: main
12-
head_ref:
13-
description: Ref with the change applied
14-
required: true
15-
bench_script:
16-
description: Benchmark script path on this branch
17-
required: true
8+
push:
9+
branches:
10+
- "claude/reflex-perf-optimizations-01l7a3-bench"
1811

1912
permissions:
2013
contents: read
@@ -30,47 +23,53 @@ jobs:
3023
steps:
3124
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3225
with:
33-
persist-credentials: false
34-
35-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
36-
with:
37-
ref: ${{ inputs.base_ref }}
38-
path: base
39-
fetch-depth: 0
40-
fetch-tags: true
41-
persist-credentials: false
42-
43-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
44-
with:
45-
ref: ${{ inputs.head_ref }}
46-
path: head
4726
fetch-depth: 0
4827
fetch-tags: true
4928
persist-credentials: false
5029

5130
- name: Install uv
5231
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
5332

33+
- name: Prepare base and head worktrees
34+
run: |
35+
BASE_REF=$(jq -r .base_ref benchmarks_scratch/run.json)
36+
HEAD_REF=$(jq -r .head_ref benchmarks_scratch/run.json)
37+
BENCH_SCRIPT=$(jq -r .bench_script benchmarks_scratch/run.json)
38+
echo "BASE_REF=$BASE_REF" >> "$GITHUB_ENV"
39+
echo "HEAD_REF=$HEAD_REF" >> "$GITHUB_ENV"
40+
echo "BENCH_SCRIPT=$BENCH_SCRIPT" >> "$GITHUB_ENV"
41+
git fetch origin "$BASE_REF" "$HEAD_REF"
42+
git worktree add /tmp/bench-base "origin/$BASE_REF"
43+
git worktree add /tmp/bench-head "origin/$HEAD_REF"
44+
5445
- name: Sync base
5546
run: uv sync
56-
working-directory: base
47+
working-directory: /tmp/bench-base
5748

5849
- name: Sync head
5950
run: uv sync
60-
working-directory: head
51+
working-directory: /tmp/bench-head
6152

62-
- name: Bench BASE (${{ inputs.base_ref }})
63-
run: uv run --no-sync python "$GITHUB_WORKSPACE/${{ inputs.bench_script }}"
64-
working-directory: base
53+
- name: Bench BASE
54+
run: |
55+
echo "=== BASE ($BASE_REF) pass 1 ==="
56+
uv run --no-sync python "$GITHUB_WORKSPACE/$BENCH_SCRIPT"
57+
working-directory: /tmp/bench-base
6558

66-
- name: Bench HEAD (${{ inputs.head_ref }})
67-
run: uv run --no-sync python "$GITHUB_WORKSPACE/${{ inputs.bench_script }}"
68-
working-directory: head
59+
- name: Bench HEAD
60+
run: |
61+
echo "=== HEAD ($HEAD_REF) pass 1 ==="
62+
uv run --no-sync python "$GITHUB_WORKSPACE/$BENCH_SCRIPT"
63+
working-directory: /tmp/bench-head
6964

70-
- name: Bench BASE pass 2 (${{ inputs.base_ref }})
71-
run: uv run --no-sync python "$GITHUB_WORKSPACE/${{ inputs.bench_script }}"
72-
working-directory: base
65+
- name: Bench BASE pass 2
66+
run: |
67+
echo "=== BASE ($BASE_REF) pass 2 ==="
68+
uv run --no-sync python "$GITHUB_WORKSPACE/$BENCH_SCRIPT"
69+
working-directory: /tmp/bench-base
7370

74-
- name: Bench HEAD pass 2 (${{ inputs.head_ref }})
75-
run: uv run --no-sync python "$GITHUB_WORKSPACE/${{ inputs.bench_script }}"
76-
working-directory: head
71+
- name: Bench HEAD pass 2
72+
run: |
73+
echo "=== HEAD ($HEAD_REF) pass 2 ==="
74+
uv run --no-sync python "$GITHUB_WORKSPACE/$BENCH_SCRIPT"
75+
working-directory: /tmp/bench-head

benchmarks_scratch/run.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"base_ref": "main",
3+
"head_ref": "claude/reflex-perf-optimizations-01l7a3-eng-10093",
4+
"bench_script": "benchmarks_scratch/bench_fix1_type_validation.py"
5+
}

0 commit comments

Comments
 (0)