원클릭으로
profile
Run CPU and memory profiling with pprof to identify performance hotspots. Use when investigating high resource usage.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Run CPU and memory profiling with pprof to identify performance hotspots. Use when investigating high resource usage.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Run Go benchmarks and compare results to detect performance regressions. Use before and after performance-related changes.
Run pre-push quality checks (vet + lint + tests with race detector). Use before pushing code.
Run tests with coverage analysis and identify untested code paths. Use to find gaps before releases.
Check and tidy Go module dependencies. Use after adding/removing imports or before releases.
Run go generate to build templ templates and frontend assets. Use after changing templates or CSS/JS.
Run integration tests that require Docker (Postgres, MinIO via testcontainers). Use to validate database and storage behavior.
| name | profile |
| description | Run CPU and memory profiling with pprof to identify performance hotspots. Use when investigating high resource usage. |
| disable-model-invocation | true |
| argument-hint | cpu|memory|all package-path |
Profile Go code to identify CPU hotspots and memory allocators using pprof.
/profile cpu ./internal/index/ - CPU profiling on index package/profile memory ./internal/repo/ - Memory profiling on repo package/profile all ./... - Both CPU and memory on all packagesParse arguments
cpu, memory, or all)./...)Create profile output directory
mkdir -p .profiles
Run profiling benchmarks
For CPU profiling:
go test -cpuprofile=.profiles/cpu.prof -bench=. $PACKAGE 2>&1
For memory profiling:
go test -memprofile=.profiles/mem.prof -bench=. $PACKAGE 2>&1
Analyze CPU profile
go tool pprof -top -cum .profiles/cpu.prof 2>&1 | head -30
Identify:
Analyze memory profile
go tool pprof -top -alloc_space .profiles/mem.prof 2>&1 | head -30
Identify:
Generate flamegraph data (if requested)
go tool pprof -raw .profiles/cpu.prof > .profiles/cpu.raw
Report findings
Structure the report as:
| Function | Self% | Cum% | Observation |
|---|
| Function | Bytes | Allocs | Observation |
|---|
Watch for issues in:
(*Index).Search - Regex compilation, line reading(*Repository).Load - Index file mapping(*IndexedExtension).Update - Hot-swap operationsProfile files are stored in .profiles/. Add to .gitignore if not already present.