Two-stage PGO and BOLT workflow for GCC and Clang, covering instrumented builds, profile collection, and post-link optimisation.
- CCM score
- 62 of 100
- skills.sh installs
- 695
- GitHub stars
- 303
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers when PGO pays off, GCC and Clang instrumented and optimised build workflows, and Clang SamplePGO without instrumentation overhead
- Includes a CMake integration with
PGO_INSTRUMENTandPGO_USEoptions plus a two-phase build script for profile collection and optimised rebuild - Provides BOLT post-link steps with
perf2bolt,llvm-boltinstrumentation, and-reorder-blocks=ext-tspand-reorder-functions=cdsortlayout options - Designed for C/C++ teams that have already applied
-O3and-march=nativeand need further runtime gains
Install
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill pgo -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
PGO (Profile-Guided Optimisation)
Purpose
Guide agents through the full PGO workflow: instrument build → representative workload → collect profile → optimised build, covering both GCC and Clang, plus BOLT for post-link optimisation.
Triggers
- "How do I use PGO to speed up my binary?"
- "What is profile-guided optimization and when should I use it?"
- "How do I use
-fprofile-generateand-fprofile-use?" - "My
-O3build isn't fast enough — what next?" - "How does BOLT differ from PGO?"
- "How do I collect representative profile data?"
Workflow
1. When to use PGO
Is -O3 -march=native already applied?
no → apply standard optimisation first
yes → is workload branch-heavy or has irregular call patterns?
yes → PGO will likely help 5-30%
no → PGO may not help; profile first with linux-perf
PGO helps most with:
- Large binaries with many cold/hot code paths (compilers, databases, servers)
- Branch-heavy code where static prediction is wrong
- Function call-heavy code where inlining decisions improve with profile data
2. GCC PGO workflow
Details
- Repository
- github.com/mohitmishra786/low-level-dev-skills
- First seen
- Jun 3, 2026
Questions
What is the PGO skill for C/C++ and what does it cover?
The pgo skill guides agents through the full profile-guided optimization workflow for C and C++ with GCC and Clang. It covers instrumented builds, collecting representative workload profiles, optimized rebuilds, and BOLT post-link optimization.
When should I use profile-guided optimization?
Use it when runtime performance plateaus after -O3 and -march=native are applied, especially for branch-heavy code or code with irregular call patterns. The skill notes that large binaries such as compilers, databases and servers tend to benefit most.
How do I install the pgo skill?
Run npx -y skills add mohitmishra786/low-level-dev-skills --skill pgo -y in your project. The agent then gains guidance for building, profiling and optimizing C or C++ binaries with PGO and BOLT.
How does BOLT differ from PGO?
BOLT reorders functions and basic blocks in the final linked binary using profile data to improve instruction cache locality, and it is applied after PGO. The skill describes it as adding roughly 5-15% more performance on top of a PGO build.
More from mohitmishra786/low-level-dev-skills
All 54- Interpreters689
- Cargo Workflows686
- Meson685
- Rust Debugging676
- Cpp Modules669
- Hardware Counters666
- Debug Optimized Builds652
- Rustc Basics649
- Cpp Templates648
- Rust Cross642
- Wasm Emscripten628
- Zig Debugging617
- Zig Build System616
- Wasm Wasmtime599
- Zig Cross598
- Zig Cinterop586
- Cmake2K
- Static Analysis1.4K
- Gdb1.3K
- Llvm1K
- Sanitizers1K
- Core Dumps948
- Assembly X86947
- Linux Perf916
Similar to Pgo
flamegraphsmohitmishra786/low-level-dev-skills837 installsGenerate, convert, and read flamegraphs from perf, Callgrind, Go, DTrace, or Java profiler output for bottleneck analysis.
rust-profilingmohitmishra786/low-level-dev-skills810 installsRust profiling workflow covering flamegraphs, binary size, monomorphization bloat, and Criterion microbenchmarks.
golang-performancesamber/cc-skills-golang45.1K installsGo performance patterns for allocation reduction, CPU efficiency, GC tuning, pooling, and caching, applied per bottleneck.
codspeed-optimizecodspeedhq/codspeed782 installsAutonomous performance loop that measures, profiles, and iterates on code speedups using CodSpeed benchmarks and flamegraphs.
profiling-optimizationaj-geddes/useful-ai-prompts458 installsStructured profiling workflow covering CPU profiling, flame graphs, and benchmarking for performance bottlenecks.