Profile

From PeterBooker/veloria · View interactive version

Profile is an AI agent skill from the GitHub repository PeterBooker/veloria. Run CPU and memory profiling with pprof to identify performance hotspots. Use when investigating high resource usage.

How to use this skill

Skill file

CPU and Memory Profiling

Profile Go code to identify CPU hotspots and memory allocators using pprof.

Usage

Steps

  1. Parse arguments
  1. Create profile output directory

```bash

mkdir -p .profiles

```

  1. Run profiling benchmarks

For CPU profiling:

```bash

go test -cpuprofile=.profiles/cpu.prof -bench=. $PACKAGE 2>&1

```

For memory profiling:

```bash

go test -memprofile=.profiles/mem.prof -bench=. $PACKAGE 2>&1

```

  1. Analyze CPU profile

```bash

go tool pprof -top -cum .profiles/cpu.prof 2>&1 | head -30

```

Identify:

  1. Analyze memory profile

```bash

go tool pprof -top -alloc_space .profiles/mem.prof 2>&1 | head -30

```

Identify:

  1. Generate flamegraph data (if requested)

```bash

go tool pprof -raw .profiles/cpu.prof > .profiles/cpu.raw

```

  1. Report findings

Structure the report as:

### CPU Hotspots

| Function | Self% | Cum% | Observation |

|----------|-------|------|-------------|

### Memory Allocators

| Function | Bytes | Allocs | Observation |

|----------|-------|--------|-------------|

### Optimization Suggestions

Interpreting Results

CPU Profile Indicators

Memory Profile Indicators

Common Hotspots in Veloria

Watch for issues in:

Cleanup

Profile files are stored in .profiles/. Add to .gitignore if not already present.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.