Skip to content

Commit 47bd062

Browse files
jbachorikclaude
andcommitted
Fix comparison script to work across branches
Copy test script to temp location before branch switch since benchmark scripts don't exist on main branch yet. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 7deb5dc commit 47bd062

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

ddprof-lib/benchmarks/branch-prediction/compare_branch_prediction.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,18 @@ main() {
110110
fi
111111
fi
112112

113+
# Save test script since it won't exist on main branch
114+
local temp_test_script="/tmp/test_branch_prediction_perf_$$.sh"
115+
cp "${TEST_SCRIPT}" "${temp_test_script}"
116+
113117
# Test optimized version (current branch)
114118
log_step "1/4: Building optimized version (${current_branch})..."
115119
cd "${REPO_ROOT}"
116120
./gradlew ddprof-lib:build -x test
117121
cd - > /dev/null
118122

119123
log_step "2/4: Testing optimized version..."
120-
"${TEST_SCRIPT}" "${benchmark}" "optimized"
124+
"${temp_test_script}" "${benchmark}" "optimized"
121125

122126
# Switch to main and test baseline
123127
log_step "3/4: Switching to main branch and building baseline..."
@@ -128,7 +132,7 @@ main() {
128132
cd - > /dev/null
129133

130134
log_step "4/4: Testing baseline version..."
131-
"${TEST_SCRIPT}" "${benchmark}" "baseline"
135+
"${temp_test_script}" "${benchmark}" "baseline"
132136

133137
# Switch back
134138
log_info "Switching back to ${current_branch}..."
@@ -137,6 +141,9 @@ main() {
137141
git stash pop || true
138142
cd - > /dev/null
139143

144+
# Cleanup temp script
145+
rm -f "${temp_test_script}"
146+
140147
# Compare results
141148
echo ""
142149
compare_results \

0 commit comments

Comments
 (0)