performance
Agent skill fromdaveebbelaar/bama
Make a macOS app fast by measuring hangs, stutter, CPU, memory, and energy, then moving work off the main thread and onto the GPU. Use when the app freezes, a shortcut feels slow, dragging stutters, the fan spins, memory grows, or the user asks to optimize or profile.
How to install performance
install performance
# install the bama pack with the skills CLI
npx skills add daveebbelaar/bama# or add only this skill to Claude Code: copy the folder
skills/code/performance/
# into
~/.claude/skills/performance/ (all projects)
.claude/skills/performance/ (one project)
1# Performance23Fast means two numbers: the first frame after a key press shows in under4100 ms, and nothing on the main thread blocks for more than 50 ms. Every5change in this skill starts and ends with a **measurement**, so you know it6helped. Symptom-by-symptom fixes are in [recipes.md](recipes.md). For7video, audio, camera, Metal, or large image pipelines, also read8[gpu-media.md](gpu-media.md).910## The loop1112```text13reproduce -> measure (release build) -> find the line -> fix -> measure again -> commit with the numbers14```15161. **Reproduce.** Write the exact steps, or add a probe command to the17 debug bridge (`test-mac-app` skill) that runs the slow action and logs18 the time of each step.192. **Measure the release build.** Debug Swift is 3 to 10 times slower and20 points at the wrong code.213. **Find the line.** Pick the tool for the symptom:2223 | Symptom | Tool |24 | --- | --- |25 | App freezes, spinning pointer | `sample <App> 5`, then read the main thread stack |26 | Slow action | Time Profiler: `xcrun xctrace record --template 'Time Profiler' --attach <App> --time-limit 10s` |27 | Short freezes while typing or dragging | `--template 'Hangs'` |28 | Stutter while moving or animating | `--template 'Animation Hitches'` |29 | Memory grows | `footprint <App>`, `leaks <App>`, `--template 'Allocations'` |30 | Fan, battery | `--template 'Energy Log'`, look for timers and polling |3132 Read traces as text, not in the Instruments GUI: see "Measuring" in33…
Excerpt shown under the repository's MIT license.
