How to Use perf to Verify Performance Gains from BOLT? No Obvious Improvements Observed in Metrics
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
I tried using perf stat -a -e cycles,instructions,cache-misses,L1-icache-loads,L1-icache-load-misses,iTLB-loads,iTLB-load-misses,LLC-load-misses,major-faults,minor-faults to compare performance metrics before and after applying BOLT optimizations. However, I didn’t observe any significant improvements in the collected values. Additionally, while monitoring CPU usage, the target process’s CPU utilization remained unchanged, though overall system CPU usage decreased slightly. Is this behavior expected?
**Key observations:**
No clear reduction in cycles or instructions post-optimization.
Cache-related metrics (cache-misses, L1-icache-load-misses, etc.) showed minimal changes.
Process-level CPU usage stayed consistent, but system-wide CPU usage dropped.
**Questions:**
Could this be due to incorrect perf event selection or measurement methodology?
Are there alternative metrics/tools better suited for validating BOLT’s impact?
Is the observed reduction in system CPU usage a valid indicator of BOLT’s effectiveness, even if process-level metrics don’t improve?
Contributor guide
Research direction
The issue provides only a perf stat command and before/after observations; start by reproducing that measurement around the BOLT-optimized binary and reviewing the relevant BOLT and perf guidance. Done means explaining whether the selected events and CPU/system-wide comparisons can validate BOLT’s impact, and identifying a suitable measurement approach if they cannot.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- compilers, performance
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100