Skip to content

wado-lang/wado / .claude/skills/profiling-wado-compiler

profiling-wado-compiler

Verified

Profile the native Rust `wado` binary (compile/serve/run) for host-side bottlenecks — wall time per phase with the span trace, CPU with a sampling profiler (samply, or perf where samply cannot run), memory with the span trace's RSS and valgrind DHAT. Use for native CPU or memory profiling, not guest wasm (see wado-performance for that).

FileKindSize
SKILL.mdskill md14.6 KB
scripts/analyze_dhat.tsscript5.2 KB
scripts/analyze_native_profile.tsexecutablescript16.3 KB
scripts/analyze_spans.tsexecutablescript4.0 KB
scripts/record_perf.shexecutablescript1.4 KB

scripts/record_perf.sh

View on GitHub
#!/usr/bin/env bash
# Record a CPU profile with `perf` where samply cannot run
# (perf_event_paranoid stays at 2), and convert it to the samply profile
# `analyze_native_profile.ts` reads.
#
#   record_perf.sh OUT.json -- COMMAND [ARGS...]
#
# Leaves OUT.json and, beside it, the raw OUT.perf.data.
set -euo pipefail

if [[ $# -lt 3 || $2 != "--" ]]; then
  echo "usage: record_perf.sh OUT.json -- COMMAND [ARGS...]" >&2
  exit 2
fi
out=$1
shift 2

# Ubuntu's /usr/bin/perf is a wrapper that refuses a kernel it has no
# linux-tools package for, so call the versioned binary directly: the running
# kernel's, or else the newest.
perf=/usr/lib/linux-tools-$(uname -r)/perf
if [[ ! -x $perf ]]; then
  perf=$(ls /usr/lib/linux-tools-*/perf 2>/dev/null | sort -V | tail -1 || true)
fi
if [[ -z $perf ]]; then
  perf=$(command -v perf || true)
fi
if [[ -z $perf ]]; then
  echo "perf not found: sudo apt-get install -y linux-tools-generic" >&2
  exit 1
fi
command -v samply >/dev/null || {
  echo "samply not found: cargo install samply --locked" >&2
  exit 1
}

data=${out%.json}.perf.data
mkdir -p "$(dirname "$out")"
# `:u` keeps the event in user space, which paranoid level 2 allows. The
# compiler is built without frame pointers, so unwind with DWARF.
"$perf" record -e cpu-clock:u -F 499 --call-graph dwarf,16384 -o "$data" -- "$@"
samply import "$data" --save-only -o "$out"
echo "profile: $out" >&2
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall