Performance profiling principles. Measurement, analysis, and optimization techniques.
Add this skill
npx mdskills install sickn33/performance-profilingComprehensive performance profiling reference with clear workflow, metrics, and tooling guidance
1---2name: performance-profiling3description: Performance profiling principles. Measurement, analysis, and optimization techniques.4allowed-tools: Read, Glob, Grep, Bash5---67# Performance Profiling89> Measure, analyze, optimize - in that order.1011## ๐ง Runtime Scripts1213**Execute these for automated profiling:**1415| Script | Purpose | Usage |16|--------|---------|-------|17| `scripts/lighthouse_audit.py` | Lighthouse performance audit | `python scripts/lighthouse_audit.py https://example.com` |1819---2021## 1. Core Web Vitals2223### Targets2425| Metric | Good | Poor | Measures |26|--------|------|------|----------|27| **LCP** | < 2.5s | > 4.0s | Loading |28| **INP** | < 200ms | > 500ms | Interactivity |29| **CLS** | < 0.1 | > 0.25 | Stability |3031### When to Measure3233| Stage | Tool |34|-------|------|35| Development | Local Lighthouse |36| CI/CD | Lighthouse CI |37| Production | RUM (Real User Monitoring) |3839---4041## 2. Profiling Workflow4243### The 4-Step Process4445```461. BASELINE โ Measure current state472. IDENTIFY โ Find the bottleneck483. FIX โ Make targeted change494. VALIDATE โ Confirm improvement50```5152### Profiling Tool Selection5354| Problem | Tool |55|---------|------|56| Page load | Lighthouse |57| Bundle size | Bundle analyzer |58| Runtime | DevTools Performance |59| Memory | DevTools Memory |60| Network | DevTools Network |6162---6364## 3. Bundle Analysis6566### What to Look For6768| Issue | Indicator |69|-------|-----------|70| Large dependencies | Top of bundle |71| Duplicate code | Multiple chunks |72| Unused code | Low coverage |73| Missing splits | Single large chunk |7475### Optimization Actions7677| Finding | Action |78|---------|--------|79| Big library | Import specific modules |80| Duplicate deps | Dedupe, update versions |81| Route in main | Code split |82| Unused exports | Tree shake |8384---8586## 4. Runtime Profiling8788### Performance Tab Analysis8990| Pattern | Meaning |91|---------|---------|92| Long tasks (>50ms) | UI blocking |93| Many small tasks | Possible batching opportunity |94| Layout/paint | Rendering bottleneck |95| Script | JavaScript execution |9697### Memory Tab Analysis9899| Pattern | Meaning |100|---------|---------|101| Growing heap | Possible leak |102| Large retained | Check references |103| Detached DOM | Not cleaned up |104105---106107## 5. Common Bottlenecks108109### By Symptom110111| Symptom | Likely Cause |112|---------|--------------|113| Slow initial load | Large JS, render blocking |114| Slow interactions | Heavy event handlers |115| Jank during scroll | Layout thrashing |116| Growing memory | Leaks, retained refs |117118---119120## 6. Quick Win Priorities121122| Priority | Action | Impact |123|----------|--------|--------|124| 1 | Enable compression | High |125| 2 | Lazy load images | High |126| 3 | Code split routes | High |127| 4 | Cache static assets | Medium |128| 5 | Optimize images | Medium |129130---131132## 7. Anti-Patterns133134| โ Don't | โ Do |135|----------|-------|136| Guess at problems | Profile first |137| Micro-optimize | Fix biggest issue |138| Optimize early | Optimize when needed |139| Ignore real users | Use RUM data |140141---142143> **Remember:** The fastest code is code that doesn't run. Remove before optimizing.144
Full transparency โ inspect the skill content before installing.