/analyzing-blackfire-profiles:analyzing-blackfire-profilesfrom analyzing-blackfire-profiles
Use PROACTIVELY when you investigate, analyze, debug, or review performance issues using Blackfire.io profiles. Triggers on: 'blackfire profile', 'performance analysis', 'investigate slow', 'profile URL', app.blackfire.io URLs, slow requests, high CPU/IO, N+1 detection, or query optimization. Covers: header triage, callgraph analysis, SQL/HTTP views, timeline inspection, drill-down debugging, and interpreting recommendations.
Ships in analyzing-blackfire-profiles. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Systematic approach to analyzing Blackfire.io performance profiles using Chrome browser automation.
STOP! Before ANY callgraph analysis, you MUST apply this JavaScript fix.
The default Blackfire UI truncates function names (e.g., ...ecute(...)) making analysis impossible. This fix is NON-NEGOTIABLE.
document.querySelector('.graph-pane').style.position = 'static';
document.querySelectorAll('div').forEach(d => {
if(d.style.cssText.includes('position: fixed') && d.style.cssText.includes('height: 100%'))
d.style.width = '1400px';
});
When to apply: Immediately after navigating to any Blackfire profile, BEFORE reading the callgraph.
What it does: Hides the visual graph and widens the sidebar to show full function names like Doctrine\ORM\UnitOfWork::computeChangeSet instead of ...Work::compu....
If you skip this: You cannot identify functions, making all subsequent analysis meaningless.
┌─────────────────────────────────────────────────────────────┐
│ STEP 0: APPLY SIDEBAR FIX (MANDATORY - DO THIS FIRST!) │
│ └─ Run JavaScript fix immediately after page load │
├─────────────────────────────────────────────────────────────┤
│ STEP 1: HEADER TRIAGE (5 seconds) │
│ └─ Identify bottleneck TYPE: I/O vs CPU vs Memory │
├─────────────────────────────────────────────────────────────┤
│ STEP 2: BRANCH TO SPECIALIZED VIEW │
│ ├─ I/O-bound → SQL/HTTP view first │
│ ├─ CPU-bound → Callgraph first │
│ └─ Unclear → "All" view to disambiguate │
├─────────────────────────────────────────────────────────────┤
│ STEP 3: CALLGRAPH DEEP DIVE │
│ └─ Three-sort → Drill-down → Focused view │
├─────────────────────────────────────────────────────────────┤
│ STEP 4: RECOMMENDATIONS + TIMELINE (if needed) │
└─────────────────────────────────────────────────────────────┘
This is the most important step. The header tells you WHERE to look next.
After navigation, read the header bar metrics:
┌──────────────┬──────────────┬──────────────┬──────────────┬──────────────┐
│ Wall Time │ I/O Wait │ CPU │ Memory │ Network │
│ 15.4 s │ 4.78 s │ 10.6 s │ 165 MB │ 2.9 MB │
└──────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
Calculate the dominant dimension:
| If Header Shows | Bottleneck Type | Next Step |
|---|---|---|
| I/O Wait > 50% of Wall Time | I/O-bound (database, network) | → Go to SQL/HTTP View |
| CPU > 50% of Wall Time | CPU-bound (computation) | → Go to Callgraph |
| ~50/50 split or unclear | Mixed workload | → Use "All" View to disambiguate |
| Memory very high | Memory-bound | → Check hydration count, then Callgraph |
Example calculations:
"Optimize the dominating bottleneck first." - Performance Engineering Principle
If the profile is 70% I/O wait, drilling into CPU-heavy functions wastes time. The header tells you which tool to use:
Use this when: Header shows I/O Wait > 50% of Wall Time
Click SQL in left sidebar for database analysis.
What to check:
Red flags:
| Pattern | Threshold |
|---|---|
| Same query repeated | >50 calls |
| High entity count | >1000 |
| Total queries | >100 for simple page |
Click HTTP for external API calls:
After SQL/HTTP analysis: Proceed to Callgraph (Step 3) to find the CODE causing these queries.
Use this when: Header shows ~50/50 split between I/O and CPU, or you need per-function dimensional breakdown.
Click "All" button in the header bar (next to "Wall Time").
What "All" view provides:
When to use:
After "All" view analysis: Click the specific dimension header (Wall Time, CPU, etc.) to switch to that focused view for deeper analysis.
Click Callgraph in left sidebar. This is the most powerful view for finding root causes.
Run this immediately - default view truncates function names making analysis impossible:
document.querySelector('.graph-pane').style.position = 'static';
document.querySelectorAll('div').forEach(d => {
if(d.style.cssText.includes('position: fixed') && d.style.cssText.includes('height: 100%'))
d.style.width = '1400px';
});
This hides the graph and widens the sidebar to show full names like Doctrine\ORM\UnitOfWork::computeChangeSet.
| Column | What It Shows | Best For |
|---|---|---|
| Function calls | Full function name with namespace | Identifying what code is running |
| % Excl. | Time spent IN this function (not children) | Finding hot spots - where time actually burns |
| % Incl. | Time spent in function + all children | Understanding call hierarchy top-down |
| Calls | Number of times function was called | Detecting N+1 patterns and loops |
This is the core debugging workflow. Use all three sorts:
PDOStatement::execute, ObjectHydrator::*, event listenersClick "Calls" column to sort by call count descending.
| Call Count | Likely Issue |
|---|---|
| >100K | Framework overhead from too many entities |
| >10K | Possible N+1 or excessive lazy loading |
| >1K | Worth investigating if exclusive time is also high |
Pattern recognition:
hydrateColumnInfo 900K+ calls → too many entities hydratedpostLoad listener count ≈ number of entities loadedmain() → Kernel::handle → Controller::actionClick any function row to open the details panel.
Panel Structure:
Callers Section (orange bar at top)
Function Metrics (middle)
Callees Section (colored bars at bottom)
Drill-Down Workflow:
1. Click hot spot in list (high % Excl.)
2. Look at callees - which child consumes most time?
3. Click that callee's bar to expand
4. Repeat until you find the root cause
Click the magnifying glass icon (🔍) next to any function name.
What it does:
To exit: Click "All" button in header or reload page.
Click Recommendations (badge shows count) for automated findings.
Common issues detected:
Click "How to fix" for remediation guidance.
Click Timeline for chronological execution view. Use when execution order matters.
Before using Timeline: Run location.reload(true) to reset the UI after sidebar fix.
| Metric | Warning | Critical |
|---|---|---|
| doctrine.entities.hydrated | >1000 | >5000 |
| doctrine.orm.flush | >5 | >20 |
| sql | >100 | >500 |
| http.curl.requests | >10 | >50 |
| Pattern | Indicates |
|---|---|
| Many thin vertical blocks | N+1 queries |
| Sudden memory spike | Large allocation/leak |
| Wide single block | Long-running function |
| Gaps in timeline | I/O wait / external calls |
| Metric | Warning | Critical |
|---|---|---|
| Wall Time | >5s | >15s |
| Same SQL query | >50x | >200x |
| ORM entities | >5K | >20K |
| External HTTP | >10 | >50 |
1. HEADER TRIAGE
├─ I/O > 50%? → SQL view → Find slow/repeated queries
├─ CPU > 50%? → Callgraph → Find heavy functions
└─ Unclear? → "All" view → See per-function breakdown
2. CALLGRAPH (always needed for root cause)
├─ Apply sidebar fix (MANDATORY)
├─ % Excl. sort → Find hot spots
├─ Calls sort → Find N+1 patterns
└─ Drill-down → Trace to root cause
3. FOCUSED VIEW
└─ Click 🔍 → Isolate one call tree
4. RECOMMENDATIONS
└─ Check automated findings
| Component | Time | % of Total |
|-----------|------|------------|
| Total Request | Xs | 100% |
| Function A | Xs | X% |
| → Child B | Xs | X% |
location.reload(true) after sidebar fixWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub shopsys/claude-plugins --plugin analyzing-blackfire-profilesOther plugins' skills for the same job