AgentSkillsCN

bench

为注册表运行性能基准测试。在测试性能、测量延迟、检查吞吐量、执行基准测试套件,或分析路由、内存与调度性能时使用。

SKILL.md
--- frontmatter
name: bench
description: Run performance benchmarks for the registry. Use when testing performance, measuring latency, checking throughput, running the benchmark suite, or analyzing routing/memory/dispatch performance.

Benchmark Runner

Run performance benchmarks using Bun's native test runner.

Usage

text
/bench              - Run all benchmarks
/bench routing      - Run routing benchmarks
/bench memory       - Run memory benchmarks
/bench dispatch     - Run dispatch benchmarks
/bench cold-start   - Run cold start benchmarks
/bench federation   - Run federation matrix benchmarks
/bench redis        - Run Redis performance benchmarks
/bench --quick      - Quick run with fewer iterations

Performance Targets (SLA)

TargetValueDescription
Dispatch latency<0.03msURLPattern match + param extraction
Route test<0.01msURLPattern.test() only
P99 latency10.8ms99th percentile request cycle
Bundle size9.64KBMinified standalone binary
Heap reduction-14%vs Node.js baseline

Additional Flags

text
/bench --json           - Output JSON for CI integration
/bench --compare <file> - Compare against baseline file
/bench --save <file>    - Save results as baseline
/bench integration      - Run integration benchmarks

Examples

bash
# Run full benchmark suite
bun run bench

# Check routing performance
/bench routing

# Quick validation
/bench --quick

# Save baseline for CI
/bench --save benchmarks/baseline.json

# Compare against baseline
/bench --compare benchmarks/baseline.json

Performance Tiers

TierThresholdIndicator
EXCELLENT<80% of targetGreen
GOOD<100% of targetBlue
ACCEPTABLE<120% of targetYellow
POOR>120% of targetRed

Related Skills

  • /test - Run test suites
  • /metrics - View system metrics
  • /dev - Development server