Skip to content

Commit b60468a

Browse files
committed
fix: fixes for profiler
1 parent 04f6497 commit b60468a

File tree

7 files changed

+90
-142
lines changed

7 files changed

+90
-142
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ DerivedData/
3737

3838
# Build directories
3939
build/
40+
build-*/
4041
dist/
4142
bin/
4243
obj/
@@ -87,4 +88,7 @@ missing
8788
# Core dump files (not our src/core/ directory)
8889
/core
8990
*.core
90-
vgcore.*
91+
vgcore.*
92+
93+
# Performance baseline (machine-dependent, not tracked)
94+
performance-baseline.txt

include/metagraph/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ extern "C" {
4141
// Build Information (populated by CMake)
4242
// =============================================================================
4343

44-
#define METAGRAPH_BUILD_TIMESTAMP "2025-07-22 19:59:11 UTC"
45-
#define METAGRAPH_BUILD_COMMIT_HASH "759232e083707b069c13142699341926a7a5e3f6"
44+
#define METAGRAPH_BUILD_TIMESTAMP "2025-07-22 20:14:47 UTC"
45+
#define METAGRAPH_BUILD_COMMIT_HASH "04f64976497f30fbbd5fca728f7d509893464991"
4646
#define METAGRAPH_BUILD_BRANCH "feat/docker-dev-container-image"
4747

4848
// Fallback to compiler macros if CMake variables not available

scripts/git-hooks/pre-push

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,21 @@ if [ -d "benchmarks" ] || [ -f "build/bin/mg_benchmarks" ]; then
6464
if mg_prompt "Would you like to capture baseline performance data now?"; then
6565
echo "Capturing baseline performance data..."
6666
if ./scripts/profile.sh timing; then
67-
mv timing-analysis.txt performance-baseline.txt
67+
mv .ignored/timing-analysis.txt performance-baseline.txt
6868
mg_green "✅ Baseline performance data captured"
69+
mg_yellow "Note: Performance baseline is machine-specific and not tracked in git"
6970
else
7071
mg_red "❌ Failed to capture baseline data"
7172
exit 1
7273
fi
7374
else
7475
mg_red "❌ Cannot proceed without performance baseline"
75-
echo "Run: ./scripts/profile.sh timing && mv timing-analysis.txt performance-baseline.txt"
76+
echo "Run: ./scripts/profile.sh timing && mv .ignored/timing-analysis.txt performance-baseline.txt"
7677
exit 1
7778
fi
7879
else
7980
mg_red "❌ No performance baseline data (non-interactive mode)"
80-
echo "Run: ./scripts/profile.sh timing && mv timing-analysis.txt performance-baseline.txt"
81+
echo "Run: ./scripts/profile.sh timing && mv .ignored/timing-analysis.txt performance-baseline.txt"
8182
exit 1
8283
fi
8384
else
@@ -89,8 +90,8 @@ if [ -d "benchmarks" ] || [ -f "build/bin/mg_benchmarks" ]; then
8990

9091
# Compare with baseline - would do statistical analysis in production
9192
echo "Comparing with baseline performance..."
92-
if ! diff -u performance-baseline.txt timing-analysis.txt > performance-diff.txt 2>&1; then
93-
mg_yellow "⚠️ Performance differences detected (review performance-diff.txt)"
93+
if ! diff -u performance-baseline.txt .ignored/timing-analysis.txt > .ignored/performance-diff.txt 2>&1; then
94+
mg_yellow "⚠️ Performance differences detected (review .ignored/performance-diff.txt)"
9495
# For now, don't fail on performance differences, just warn
9596
fi
9697
fi

scripts/profile.sh

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,17 @@ profile_with_perf() {
6363
./build-profile/bin/mg_benchmarks
6464

6565
# Generate reports
66-
perf report -i perf.data --stdio > perf-report.txt
67-
perf annotate -i perf.data --stdio > perf-annotate.txt
66+
mkdir -p .ignored
67+
perf report -i perf.data --stdio > .ignored/perf-report.txt
68+
perf annotate -i perf.data --stdio > .ignored/perf-annotate.txt
6869

6970
# Generate flame graph if available
7071
if command -v flamegraph >/dev/null 2>&1; then
71-
perf script -i perf.data | flamegraph > flamegraph.svg
72-
echo "[INFO] Flame graph generated: flamegraph.svg"
72+
perf script -i perf.data | flamegraph > .ignored/flamegraph.svg
73+
echo "[INFO] Flame graph generated: .ignored/flamegraph.svg"
7374
fi
7475

75-
echo "[INFO] Perf reports generated: perf-report.txt, perf-annotate.txt"
76+
echo "[INFO] Perf reports generated: .ignored/perf-report.txt, .ignored/perf-annotate.txt"
7677
}
7778

7879
# Memory profiling with Valgrind
@@ -111,9 +112,10 @@ profile_with_gprof() {
111112
./build-profile/bin/mg_benchmarks
112113

113114
# Generate profile report
114-
gprof ./build-profile/bin/mg_benchmarks gmon.out > gprof-report.txt
115+
mkdir -p .ignored
116+
gprof ./build-profile/bin/mg_benchmarks gmon.out > .ignored/gprof-report.txt
115117

116-
echo "[INFO] gprof report generated: gprof-report.txt"
118+
echo "[INFO] gprof report generated: .ignored/gprof-report.txt"
117119
}
118120

119121
# Benchmark timing analysis
@@ -136,8 +138,9 @@ benchmark_timing() {
136138
done
137139

138140
# Calculate statistics
139-
echo "Timing Results (Real User System MaxRSS):" > timing-analysis.txt
140-
cat "$times_file" >> timing-analysis.txt
141+
mkdir -p .ignored
142+
echo "Timing Results (Real User System MaxRSS):" > .ignored/timing-analysis.txt
143+
cat "$times_file" >> .ignored/timing-analysis.txt
141144

142145
# Calculate averages (basic awk processing)
143146
awk '{
@@ -146,12 +149,12 @@ benchmark_timing() {
146149
printf "Averages over %d runs:\n", count
147150
printf "Real: %.3fs, User: %.3fs, System: %.3fs, Peak Memory: %.0fKB\n",
148151
real/count, user/count, sys/count, mem/count
149-
}' "$times_file" >> timing-analysis.txt
152+
}' "$times_file" >> .ignored/timing-analysis.txt
150153

151154
# Clean up temporary file
152155
rm -f "$times_file"
153156

154-
echo "[INFO] Timing analysis saved to: timing-analysis.txt"
157+
echo "[INFO] Timing analysis saved to: .ignored/timing-analysis.txt"
155158
}
156159

157160
# Profile-Guided Optimization
@@ -186,9 +189,10 @@ run_pgo() {
186189
./build-profile/bin/mg_benchmarks
187190
echo "=== With PGO ==="
188191
./build-pgo-use/bin/mg_benchmarks
189-
} > pgo-comparison.txt
192+
mkdir -p .ignored
193+
} > .ignored/pgo-comparison.txt
190194

191-
echo "[INFO] PGO comparison saved to: pgo-comparison.txt"
195+
echo "[INFO] PGO comparison saved to: .ignored/pgo-comparison.txt"
192196
}
193197

194198
# Fuzzing with address sanitizer

0 commit comments

Comments
 (0)