run-benchmarks
БесплатноБез исполняемых скриптовНе проверенChoose, run and record benchmarks (Criterion, persistence, aquatic UDP load test) with before-and-after numbers. Use when a change touches hot code or an…
от torrust★ 539 звёзд на GitHubОб этом скилле
Running Benchmarks
docs/benchmarking.md is the source of truth: it lists every
benchmark with its command, says what each one measures, and gives the criteria for choosing one.
This skill is the workflow for using it.
When a Change Needs Performance Evidence
Plan a measurement in the issue specification when the change touches code on the request path (connection IDs, announce, scrape, the receive loop), the torrent repository, persistence, or any code the maintainer calls performance-critical. Reasoning that the change is cheap is not enough; measure it.
Workflow
- Choose the instruments. Use the Choosing a Benchmark criteria. For the request path, use a Criterion microbenchmark of the changed code plus the end-to-end UDP load test.
- Check that each instrument measures something. Compare its result with a known cost. Watch
for an
async fnpassed tob.iterwithout being awaited; see Checking That a Benchmark Measures Something. If the changed code has no benchmark, add one in its own commit before any production change, and give a new async benchmark the routine guard. - Write the pass rule in the specification: one-sided, against the baseline (after mean not below the lowest baseline run; after median not above the highest baseline median).
- Measure the baseline before any production change, following
Recording Before-and-After Evidence.
Run
uptimefirst; on a shared machine, wait for other builds to finish. Check that no other tracker is running and the benchmark ports are free, including the health check API's default127.0.0.1:1313(see step 5 of that section). - Implement the change, then measure again on the same machine with the same settings.
- Record both in issue-local
performance-evidence.md: machine, toolchain, commands, every run, the noise, and the comparison against the pass rule. Take times from output files orgit log, not from memory. Investigate a failure, for example with profiling, before closing the issue.
Quick Commands
# Criterion microbenchmarks of one package (all benches, or one with --bench <name>)
cargo bench -p torrust-tracker-udp-core
cargo bench -p torrust-tracker-udp-core --bench connection_cookie_benchmark
# Release build for the end-to-end UDP load test (see docs/benchmarking.md for aquatic)
cargo build --release --bin torrust-tracker
./target/release/torrust-tracker --config-toml-path ./share/default/config/tracker.udp.benchmarking.toml
Pitfalls
- Criterion's
time:line is a mean estimate; read the median fromtarget/criterion/<group>/<function>/new/estimates.json. The group's/becomes_, and each run overwrites the file, so read it after every run. - Verbose logging cuts UDP throughput by about ten times; the benchmarking configuration uses
trace_filter = "error". - The load test varies by about ±5–10% between runs on a desktop. It rules out only large regressions; rely on the microbenchmark for small ones.
- A benchmark is not a correctness test. Keep the regression tests the change needs.
Skill Links
Review this skill when changing:
docs/benchmarking.md— benchmark catalog, selection criteria, and evidence procedure.contrib/dev-tools/benches/run-benches.sh— local script that runs the package benchmarks.share/default/config/tracker.udp.benchmarking.toml— the load-test tracker configuration.
Установить run-benchmarks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл run-benchmarks?
Choose, run and record benchmarks (Criterion, persistence, aquatic UDP load test) with before-and-after numbers. Use when a change touches hot code or an issue needs performance evidence.
Как установить скилл run-benchmarks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл run-benchmarks запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic