Skip to content

Commit 46ea6e9

Browse files
committed
Finishing touches
1 parent def184e commit 46ea6e9

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

.github/workflows/performance_score_director.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,36 +170,48 @@ jobs:
170170
NEW_RANGE_END: ${{ steps.benchmark_new.outputs.RANGE_END }}
171171
shell: bash
172172
run: |
173+
export DIFF_START=$(echo "scale=2; ($OLD_RANGE_START / $NEW_RANGE_START) * 100" | bc)
174+
export DIFF_MID=$(echo "scale=2; ($OLD_RANGE_MID / $NEW_RANGE_MID) * 100" | bc)
175+
export DIFF_END=$(echo "scale=2; ($OLD_RANGE_END / $NEW_RANGE_END) * 100" | bc)
173176
export FAIL=false
177+
174178
if [ "$NEW_RANGE_START" -le "$OLD_RANGE_END" ] && [ "$NEW_RANGE_END" -ge "$OLD_RANGE_START" ]; then
175179
if [ "$NEW_RANGE_START" -ge "$OLD_RANGE_MID" ]; then
176-
echo "### 🍀Possible improvement 🍀" >> $GITHUB_STEP_SUMMARY
180+
echo "### 🍀 Possible improvement 🍀" >> $GITHUB_STEP_SUMMARY
177181
elif [ "$OLD_RANGE_END" -le "$NEW_RANGE_MID" ]; then
178-
echo "### ⚠️Possible regression ⚠️" >> $GITHUB_STEP_SUMMARY
182+
echo "### ⚠️ Possible regression ⚠️" >> $GITHUB_STEP_SUMMARY
179183
else
180184
echo "### Performance unchanged " >> $GITHUB_STEP_SUMMARY
181185
fi
182186
elif [ "$NEW_RANGE_START" -gt "$OLD_RANGE_END" ]; then
183-
echo "### 🚀🚀🚀 Statistically significant improvement 🚀🚀🚀" >> $GITHUB_STEP_SUMMARY
187+
if [ "$DIFF_MID" -gt "98" ]; then
188+
# Ignore differences of up to 2 %.
189+
echo "### Performance unchanged" >> $GITHUB_STEP_SUMMARY
190+
echo "(Decided to ignore a very small difference of under 2 %.)" >> $GITHUB_STEP_SUMMARY
191+
else
192+
echo "### 🚀🚀🚀 Statistically significant improvement 🚀🚀🚀" >> $GITHUB_STEP_SUMMARY
193+
fi
184194
else
185-
echo "### ‼️‼️‼️ Statistically significant regression ‼️‼️‼️" >> $GITHUB_STEP_SUMMARY
186-
export FAIL=true
195+
if [ "$DIFF_MID" -lt "102" ]; then
196+
# Ignore differences of up to 2 %.
197+
echo "### Performance unchanged" >> $GITHUB_STEP_SUMMARY
198+
echo "(Decided to ignore a very small difference of under 2 %.)" >> $GITHUB_STEP_SUMMARY
199+
else
200+
echo "### ‼️‼️‼️ Statistically significant regression ‼️‼️‼️" >> $GITHUB_STEP_SUMMARY
201+
export FAIL=true
202+
fi
187203
fi
188-
189-
export DIFF_START=$(echo "scale=2; ($OLD_RANGE_START / $NEW_RANGE_START) * 100" | bc)
190-
export DIFF_MID=$(echo "scale=2; ($OLD_RANGE_MID / $NEW_RANGE_MID) * 100" | bc)
191-
export DIFF_END=$(echo "scale=2; ($OLD_RANGE_END / $NEW_RANGE_END) * 100" | bc)
192-
204+
193205
echo "| | **Ref** | **Min** | **Mean** | **Max** |" >> $GITHUB_STEP_SUMMARY
194206
echo "|:------:|:-----------:|:-----------------:|:-----------------:|:-----------------:|" >> $GITHUB_STEP_SUMMARY
195-
echo "| _Old_ | ${{ github.event.inputs.baseline }} | ${OLD_RANGE_START} | ${OLD_RANGE_MID} | ${OLD_RANGE_END} |" >> $GITHUB_STEP_SUMMARY
196-
echo "| _New_ | ${{ github.event.inputs.branch }} | ${NEW_RANGE_START} | ${NEW_RANGE_MID} | ${NEW_RANGE_END} |" >> $GITHUB_STEP_SUMMARY
207+
echo "| _Old_ | [v${{ github.event.inputs.baseline }}](https://github.com/TimefoldAI/timefold-solver/releases/tag/v${{ github.event.inputs.baseline }}) | ${OLD_RANGE_START} | ${OLD_RANGE_MID} | ${OLD_RANGE_END} |" >> $GITHUB_STEP_SUMMARY
208+
echo "| _New_ | [${{ github.event.inputs.branch }}](https://github.com/${{ github.event.inputs.branch_owner }}/timefold-solver/tree/${{ github.event.inputs.branch }}) | ${NEW_RANGE_START} | ${NEW_RANGE_MID} | ${NEW_RANGE_END} |" >> $GITHUB_STEP_SUMMARY
197209
echo "| _Diff_ | | ${DIFF_START} % | ${DIFF_MID} % | ${DIFF_END} % |" >> $GITHUB_STEP_SUMMARY
198210
199211
echo "" >> $GITHUB_STEP_SUMMARY
200212
echo "Min and max define a 99.9 % confidence interval." >> $GITHUB_STEP_SUMMARY
201213
echo "Min and max are in operations per second. Higher is better." >> $GITHUB_STEP_SUMMARY
202-
echo "Diff over 100 % represents an improvement, under 100 % a regression." >> $GITHUB_STEP_SUMMARY
214+
echo "Diff under 100 % represents an improvement, over 100 % a regression." >> $GITHUB_STEP_SUMMARY
203215
204216
if [ "$FAIL" = true ]; then
205217
exit 1

0 commit comments

Comments
 (0)