You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .autoloop/programs/perf-comparison/program.md
+51-16Lines changed: 51 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,9 @@ This is an open-ended program — it runs continuously, always adding the next b
22
22
- Creates the same dataset as the TypeScript version
23
23
- Runs the same operation with the same loop structure
24
24
- Outputs the same JSON format
25
-
5.**Run both benchmarks**via `benchmarks/run_benchmarks.sh` and capture results.
26
-
6.**Update `benchmarks/results.json`** with the new timing data.
27
-
7.**Update `playground/benchmarks.html`**to display the new function's comparison metrics.
25
+
5.**Update `playground/benchmarks.html`**if needed to display the new function's comparison metrics.
26
+
27
+
The evaluation step (below) runs `benchmarks/run_benchmarks.sh` to execute **every** TS/Python benchmark pair and regenerates `benchmarks/results.json` with the real timing data. That regenerated file is what gets committed on a successful iteration, so when the autoloop branch is merged to `main`, the pages workflow (`.github/workflows/pages.yml`) picks up the real results and `playground/benchmarks.html` renders real comparison data instead of "No benchmark data available yet."
28
28
29
29
### Key constraints
30
30
@@ -50,24 +50,59 @@ Do NOT modify:
50
50
51
51
## Evaluation
52
52
53
+
The evaluation runs `benchmarks/run_benchmarks.sh`, which executes every TS/Python
54
+
benchmark pair and writes real timing data to `benchmarks/results.json`. The metric
55
+
is the number of benchmarks that appear in that regenerated file — i.e. the number
56
+
of function pairs whose benchmarks actually ran to completion and produced valid
57
+
JSON output. This means a benchmark pair is only "counted" if it truly runs, and
58
+
the committed `benchmarks/results.json` always reflects real data that the
59
+
`pages.yml` workflow will copy to the playground on merge to `main`.
60
+
53
61
```bash
54
-
# Set up Python environment if needed
62
+
set -euo pipefail
63
+
64
+
# Ensure Python and pandas are available
55
65
if!command -v python3 &>/dev/null;then
56
-
echo"Python3 not found, skipping"
66
+
echo"ERROR: python3 is required but not found">&2
67
+
exit 1
57
68
fi
58
-
pip3 install pandas --quiet 2>/dev/null ||true
59
-
60
-
#Count the number of benchmark pairs (functions with both TS and Python benchmarks)
0 commit comments