← ClaudeAtlas

benchmarklisted

Benchmark and profile the current program (C / C++ first, also Rust and Python) with the tools available (perf stat / record / report, hyperfine, valgrind callgrind / massif, heaptrack, flame graphs), asking before installing a missing tool - optimized build with symbols in a copy, wall time, hardware counters, hot functions (self and inclusive), hot lines, memory - then the analysis of what is slow and why, each finding classified as a quick win or a complex change with its estimated gain, delivered as a PDF / Markdown report (report skill), and optionally the optimizations with a before / after comparison. Use whenever the user asks for a benchmark, a profiling, a performance analysis, what is slow, which function takes the time, or how to optimize a program.
TsukiNi22/ai-utils · ★ 1 · Data & Documents · score 74
Install: claude install-skill TsukiNi22/ai-utils
# Benchmark & profiling `SKILL_DIR` = the directory of this file. Scripts: `scripts/tools.sh` (tools available / install commands), `scripts/profile.sh` (build + measures), `scripts/hotspots.py` (tables for the report). Reports: the `report` skill. Nothing is committed, the outputs stay in `/tmp/benchmark-*` unless the user asks. ## 1. Ask (one AskUserQuestion call, French) - only what the request doesn't say - **Scénario mesuré**: the command(s) and the inputs, representative of the real use (a big input, the test suite, a benchmark target...); propose the obvious one from the project (`./<binary> <typical args>`, the GTest binary). - **Ce qui compte**: temps CPU / latence, mémoire, les deux. - **Profondeur**: `Rapide (perf + temps) (Recommandé)` · `Complète (+ callgrind + mémoire, plus lent)`. The report format is asked by the `report` skill (once). ## 2. Tools ```bash bash SKILL_DIR/scripts/tools.sh ``` Lists `perf`, `hyperfine`, `valgrind`, `heaptrack`, `flamegraph`, `/usr/bin/time`, `py-spy` with the install command of the OS and the `perf_event_paranoid` level. When a tool **useful for the chosen depth** is missing, ask (AskUserQuestion): `Installer (je lance la commande)` · `Tu les installes (commande donnée)` · `Continuer sans`. Never install without a yes. Root commands go through the sudo method of the environment (on this computer: `SUDO_ASKPASS=~/.local/bin/sudo-askpass sudo -A <command>`, see the global instructions). `perf_event_paranoid` > 2: same question