Skip to content

Commit

Permalink
Don't run on push anymore
Browse files Browse the repository at this point in the history
Test running against itself to see if the numbers will be similar
  • Loading branch information
ire4ever1190 committed Oct 29, 2024
1 parent 710eec2 commit fd220df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Benchmarking

on:
push: # Remove when finished
pull_request:

permissions:
Expand Down Expand Up @@ -34,7 +33,7 @@ jobs:
run: cp .github/workflows/bench.sh bench.sh

- name: Run on master
run: ./bench.sh master
run: ./bench.sh $GITHUB_SHA

- name: Run on branch
run: ./bench.sh $GITHUB_SHA
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/stats.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ template formatVal(x: float): string = formatFloat(x, ffDecimal, 5)
template writeRow(metric: untyped, name: string, lowerBetter = true) =
let
diff = (when lowerBetter: -1 else: 1) * (candidate.metric - baseline.metric)
percentage = formatFloat((diff / baseline.metric) * 100, ffDecimal, 2)
echo "|", name, "|", formatVal(baseline.metric), "|", formatVal(candidate.metric), "|", percentage, "|"
percentage = (diff / baseline.metric) * 100
sign = (if percentage >= 0: "+" else: "")
formattedPercentage = sign & formatFloat(percentage, ffDecimal, 2)
echo "|", name, "|", formatVal(baseline.metric), "|", formatVal(candidate.metric), "|", formattedPercentage, "|"

echo "| Metric | Baseline | Candidate | Difference (%) |"
echo "|--------|----------|-----------|----------------|"
Expand Down

0 comments on commit fd220df

Please sign in to comment.