ワンクリックで
performance-analyzer
Use when analyzing performance issues, creating benchmarks, or optimizing code
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when analyzing performance issues, creating benchmarks, or optimizing code
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when researching state-of-the-art algorithms for a problem, finding academic papers, comparing algorithm approaches, needing paper citations, or user invokes /algorithm-research
Use when researching algorithms, data structures, optimization, performance, or need modern alternatives to classic algorithms
Use when creating benchmarks, measuring performance, comparing implementations, or user invokes /benchmark. Provides step-by-step workflow for benchmark creation, data generation, and results interpretation.
Use when analyzing code cognitive load, onboarding difficulty, or user invokes /cognitive-audit for complexity analysis and refactoring recommendations
Use when analyzing cognitive load, code complexity, onboarding difficulty, readability concerns, maintainability issues, or applying Ousterhout principles for deep modules, reducing complexity, and strategic programming approaches
Use when implementing concurrent operations, choosing between concurrency models, designing async workflows, or working with parallel data processing
| name | performance-analyzer |
| description | Use when analyzing performance issues, creating benchmarks, or optimizing code |
Never optimize without profiling data. Code review cannot tell you where bottlenecks are—only measurement can.
NO OPTIMIZATION WITHOUT PROFILING DATA
Before suggesting ANY optimization:
No exceptions:
These thoughts mean STOP—you're about to violate measurement discipline:
| Thought | Reality |
|---|---|
| "I can identify optimization opportunities" | Code review ≠ profiling. Measure first. |
| "This is obviously slow" | Obvious to you ≠ actual bottleneck. Profile. |
| "Multiple passes are inefficient" | Maybe. Measure to confirm. |
| "Lazy evaluation would be faster" | Maybe not. Benchmark both. |
| "The user knows it's an N+1 problem" | Users guess wrong. Verify with profiling. |
| "I would profile if I had access" | You do. Insist on profiling before proceeding. |
| "Let me explain how to profile" | Don't explain. Insist on actual profiling. |
All of these mean: Refuse to suggest optimizations. Profile first.
| What to Measure | Tool Type | Description |
|---|---|---|
| Function call frequency | Call profiler | Counts how many times functions called |
| Time per function | Time profiler | Measures where time is spent |
| Detailed time breakdown | Flame graph | Visual time breakdown |
| Memory allocations | Memory profiler | Tracks allocations and sizes |
| Comparison before/after | Benchmark tool | Statistical comparison |
Wrong tool = wrong conclusions:
For language-specific profiling tools:
references/elixir.md - cprof, eprof, fprof, tprofreferences/rust.md - perf, flamegraph, valgrind# Statistical benchmark template
benchmark({
"current implementation": lambda:
CurrentModule.function(input),
"proposed optimization": lambda:
OptimizedModule.function(input)
},
warmup=2, # Seconds for warmup
time=5, # Seconds for measurement
memory_time=2 # Seconds for memory measurement
)
# Output:
# Name ips average deviation median
# current 500 K 2.00 μs ±10.00% 1.98 μs
# optimized 1000 K 1.00 μs ±8.00% 0.99 μs
# Comparison:
# optimized is 2.0x faster
CRITICAL: Benchmark BEFORE changing code to establish baseline.
For language-specific benchmark frameworks:
references/elixir.md - Bencheereferences/rust.md - criterion, divanUser reports slowness or asks for optimization
↓
Has profiling data?
↓ NO ↓ YES
REFUSE to give Has baseline benchmark?
advice ↓ NO ↓ YES
↓ Create baseline Suggest optimization
Profile to find benchmark based on data
bottleneck ↓ ↓
↓ Suggest optimization based on data
→ ↓
Benchmark optimization
↓
Compare results
Only suggest these if profiling data confirms the problem:
When profiling reveals slow code AND analysis shows O(n²) or worse complexity:
Create benchmark with increasing input sizes:
benchmark({
"current O(n²)": lambda n:
CurrentImplementation.function(range(n))
},
inputs={
"100 items": 100,
"1,000 items": 1000,
"10,000 items": 10_000
}
)
If time increases quadratically with input size, algorithmic improvement is needed.
When user asks for optimization advice without profiling:
DON'T say:
DO say:
Make profiling MANDATORY, not optional.
User claims code is faster after changes:
REFUSE to confirm without benchmarks:
| Mistake | Fix |
|---|---|
| Optimizing based on code review | Profile first, optimize what's actually slow |
| Using wrong profiling tool | Match tool to what you're measuring (time/memory/calls) |
| No baseline benchmark | Measure current state before changing anything |
| Assuming optimization worked | Benchmark after changes to verify |
| Profiling in dev instead of prod-like data | Use realistic data volumes and conditions |
| Optimizing O(1) code instead of O(n²) | Profile to find where time is actually spent |
Wrong:
User: "This module looks slow"
Agent: "Use lazy evaluation instead of eager loading, and parallelize"
Right:
User: "This module looks slow"
Agent: "Let's profile it first to see where time is actually spent.
Run the time profiler:
<language-specific profiling command>
Then create a baseline benchmark:
<language-specific benchmark command>
Only after seeing profiling data can we identify the actual bottleneck."
For language-specific profiling tools, benchmark frameworks, and optimization patterns:
references/elixir.md - mix profile, Benchee, ETS optimizationreferences/rust.md - perf, criterion, flamegraph, allocation tracking