Skip to content

Commit

Permalink
chore: Update bench.sh to include lazy loading for images
Browse files Browse the repository at this point in the history
  • Loading branch information
i5heu committed May 18, 2024
1 parent 2e6ba73 commit 6f3b4c0
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,28 @@ for version in "${versions[@]}"; do
echo "Checking out version: $version"
git checkout $version

# Check if ouroboros_test.go exists
if [ -f ./ouroboros_test.go ]; then
test_cmd="go test -run='^$' -bench=. -count=6"
else
test_cmd="go test ./test -run='^$' -bench=. -count=6"
fi

echo "Running benchmarks for version: $version"
go test -run='^$' -bench=. -count=6 > "benchmarks/${version}"
eval "$test_cmd" > "benchmarks/${version}.txt"
done

# Checkout the main branch again
git checkout main

# Generate the benchstat comparison command with all the .txt files
benchstat_cmd="benchstat "
benchstat_cmd="benchstat"
for version in "${versions[@]}"; do
benchstat_cmd+=" benchmarks/${version}"
benchstat_cmd+=" benchmarks/${version}.txt"
done

# Execute the comparison command and save it as a CSV
echo "Comparing all versions with benchstat..."
eval "$benchstat_cmd" > "benchmarks/combined_benchmarks_comparison"
eval "$benchstat_cmd" > "benchmarks/combined_benchmarks_comparison.csv"

echo "Benchmarking and comparison completed."

0 comments on commit 6f3b4c0

Please sign in to comment.