Worker Benchmarks

ruvnet/ruflo/.agents/skills/worker-benchmarks

作者 ruvnet6051f6702b61無授權條款74K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫今天更新

Run comprehensive worker system benchmarks and performance analysis

AI 產生的概覽

為 agentic-flow worker 系統執行效能基準測試,並回報延遲、輸送量與記憶體指標。

功能
此技能說明如何為 agentic-flow worker 系統執行效能基準測試,涵蓋觸發器偵測、worker 登錄檔 CRUD、代理選擇、模型快取、並行 worker 與記憶體鍵產生。它列出每種基準測試的目標延遲、迭代次數與收集的指標,並展示包含通過/失敗數量、平均延遲、耗時與尖峰記憶體的格式化結果摘要。它也說明如何在設定中配置閾值,以及如何以程式方式呼叫基準測試函式。
適用情境
當你需要量測或比較 agentic-flow worker 各元件的效能、確認是否達到延遲目標,或在最佳化前後收集指標時使用。
執行需求
需要 agentic-flow 套件及其 worker 基準測試指令或匯出的基準測試函式,以及含 npx 的 Node.js 執行環境。基準測試閾值從設定檔讀取。此技能僅包含指示,不隨附指令碼。

Worker Benchmarks Skill

Run comprehensive performance benchmarks for the agentic-flow worker system.

Quick Start

bash
# Run full benchmark suitenpx agentic-flow workers benchmark
# Run specific benchmarknpx agentic-flow workers benchmark --type trigger-detectionnpx agentic-flow workers benchmark --type registrynpx agentic-flow workers benchmark --type agent-selectionnpx agentic-flow workers benchmark --type concurrent

Benchmark Types

1. Trigger Detection (trigger-detection)

Tests keyword detection speed across 12 worker triggers.

  • Target: p95 < 5ms
  • Iterations: 1000
  • Metrics: latency, throughput, histogram

2. Worker Registry (registry)

Tests CRUD operations on worker entries.

  • Target: p95 < 10ms
  • Iterations: 500 creates, gets, updates
  • Metrics: per-operation latency breakdown

3. Agent Selection (agent-selection)

Tests performance-based agent selection.

  • Target: p95 < 1ms
  • Iterations: 1000
  • Metrics: selection confidence, agent scores

4. Model Cache (cache)

Tests model caching performance.

  • Target: p95 < 0.5ms
  • Metrics: hit rate, cache size, eviction stats

5. Concurrent Workers (concurrent)

Tests parallel worker creation and updates.

  • Target: < 1000ms for 10 workers
  • Metrics: per-worker latency, memory usage

6. Memory Key Generation (memory-keys)

Tests memory pattern key generation.

  • Target: p95 < 0.1ms
  • Iterations: 5000
  • Metrics: unique patterns, throughput

Output Format

═══════════════════════════════════════════════════════════📈 BENCHMARK RESULTS═══════════════════════════════════════════════════════════
✅ Trigger Detection   Operation: detect   Count: 1,000   Avg: 0.045ms | p95: 0.120ms (target: 5ms)   Throughput: 22,222 ops$s   Memory Δ: 0.12MB
✅ Worker Registry   Operation: crud   Count: 1,500   Avg: 1.234ms | p95: 3.456ms (target: 10ms)   Throughput: 810 ops$s   Memory Δ: 2.34MB
───────────────────────────────────────────────────────────📊 SUMMARY───────────────────────────────────────────────────────────Total Tests: 6Passed: 6 | Failed: 0Avg Latency: 0.567msTotal Duration: 2345msPeak Memory: 8.90MB═══════════════════════════════════════════════════════════

Integration with Settings

Benchmark thresholds are configured in .claude$settings.json:

json
{  "performance": {    "benchmarkThresholds": {      "triggerDetection": { "p95Ms": 5 },      "workerRegistry": { "p95Ms": 10 },      "agentSelection": { "p95Ms": 1 },      "memoryKeyGeneration": { "p95Ms": 0.1 },      "concurrentWorkers": { "totalMs": 1000 }    }  }}

Programmatic Usage

typescript
import { workerBenchmarks, runBenchmarks } from 'agentic-flow$workers$worker-benchmarks';
// Run full suiteconst suite = await runBenchmarks();console.log(suite.summary);
// Run individual benchmarksconst triggerResult = await workerBenchmarks.benchmarkTriggerDetection(1000);const registryResult = await workerBenchmarks.benchmarkRegistryOperations(500);

Performance Optimization Tips

  1. Model Cache: Enable with CLAUDE_FLOW_MODEL_CACHE_MB=512
  2. Parallel Workers: Enable with CLAUDE_FLOW_WORKER_PARALLEL=true
  3. Warning Suppression: Enable with CLAUDE_FLOW_SUPPRESS_WARNINGS=true
  4. SQLite WAL Mode: Automatic for better concurrent performance

來源與署名

來源:ruvnet/ruflo位於.agents/skills/worker-benchmarks提交6051f67

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架