-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathgenerate_bench.sh
More file actions
36 lines (30 loc) · 1.01 KB
/
generate_bench.sh
File metadata and controls
36 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Generate benchmark report for the current version
VERSION=${1:-$(git rev-parse --abbrev-ref HEAD)}
DATE=$(date +%Y-%m-%d)
OUTPUT_DIR="benchmark_reports"
echo "Generating benchmark report for version: $VERSION"
echo "Date: $DATE"
# Run benchmarks and save output
REPORT_FILE="${OUTPUT_DIR}/report_${VERSION}_${DATE}.txt"
{
echo "=========================================="
echo "JSONPath Benchmark Report"
echo "=========================================="
echo ""
echo "Version: $VERSION"
echo "Date: $DATE"
echo "Go Version: $(go version | awk '{print $3}')"
echo ""
echo "=========================================="
echo "Benchmarks"
echo "=========================================="
echo ""
go test -bench=. -benchmem ./...
} > "$REPORT_FILE" 2>&1
echo "Report saved to: $REPORT_FILE"
# Also print summary
echo ""
echo "Summary:"
echo " Total benchmarks: $(grep -c "^Benchmark" "$REPORT_FILE" || echo "0")"
echo " Report size: $(wc -c < "$REPORT_FILE") bytes"