Skip to content

Commit 49a5484

Browse files
committed
fix: add debugging and pre-test for regression detection benchmarks
- Add test run before hyperfine to catch wasmtime errors early - Add --show-output flag to hyperfine for better error visibility - Create baseline_results directory before use - Test wasmtime command on both baseline and PR branches before benchmarking
1 parent 3cbb4f7 commit 49a5484

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/performance.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,11 +431,23 @@ jobs:
431431
bazel build //tinygo:file_ops_component
432432
433433
# Create test data
434+
mkdir -p baseline_results
434435
echo "Baseline test data" > baseline_test.txt
435436
437+
# Test wasmtime command first to ensure it works
438+
echo "Testing wasmtime command..."
439+
wasmtime run --dir=. bazel-bin/tinygo/file_ops_component.wasm copy_file --src baseline_test.txt --dest baseline_copy.txt || {
440+
echo "ERROR: wasmtime command failed"
441+
exit 1
442+
}
443+
444+
# Clean up test output before benchmark
445+
rm -f baseline_copy.txt
446+
436447
# Benchmark baseline using WASM component
437448
hyperfine --export-json baseline_results/baseline_benchmark.json \
438449
--warmup 3 \
450+
--show-output \
439451
'wasmtime run --dir=. bazel-bin/tinygo/file_ops_component.wasm copy_file --src baseline_test.txt --dest baseline_copy.txt'
440452
441453
- name: Checkout PR Branch
@@ -447,9 +459,20 @@ jobs:
447459
run: |
448460
bazel build //tinygo:file_ops_component
449461
462+
# Test wasmtime command first
463+
echo "Testing wasmtime command on PR branch..."
464+
wasmtime run --dir=. bazel-bin/tinygo/file_ops_component.wasm copy_file --src baseline_test.txt --dest pr_copy.txt || {
465+
echo "ERROR: wasmtime command failed on PR branch"
466+
exit 1
467+
}
468+
469+
# Clean up test output before benchmark
470+
rm -f pr_copy.txt
471+
450472
# Benchmark PR changes using WASM component
451473
hyperfine --export-json pr_results/pr_benchmark.json \
452474
--warmup 3 \
475+
--show-output \
453476
'wasmtime run --dir=. bazel-bin/tinygo/file_ops_component.wasm copy_file --src baseline_test.txt --dest pr_copy.txt'
454477
455478
- name: Analyze Performance Regression

0 commit comments

Comments
 (0)