openclaw-test-performance

Benchmarks and optimizes OpenClaw test and plugin-suite runtime, imports, CPU, and memory.

1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/JEROME-PRAKASH-L/openclaw --skill openclaw-test-performance-jerome-prakash-l
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openclaw-test-performance
Source: https://github.com/JEROME-PRAKASH-L/openclaw/tree/main/.agents/skills/openclaw-test-performance
Command: npx skills add https://github.com/JEROME-PRAKASH-L/openclaw --skill openclaw-test-performance-jerome-prakash-l

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow test suites, plugin-inspector runs, and unexplained memory growth in the OpenClaw codebase waste developer time and obscure real regressions. This Skill replaces guesswork with an evidence-first workflow that baselines wall time, Vitest duration, import cost, CPU, and RSS before and after each fix. ## Core Features & Use Cases - Evidence-Based Benchmarking: Collects wall time, Vitest duration, import breakdowns, max RSS, and CPU metrics using commands like pnpm test:perf:groups and /usr/bin/time -l. - Plugin-Suite Performance Workflow: Maps extension test suites, package-boundary checks, plugin import memory profiles, and Crabbox/Blacksmith Testbox runs for bundled plugin breadth. - Root-Cause Diagnosis: Catalogs common hotspots such as broad SDK barrels, per-test server startup, importActual() mocks, and missing timing fixtures, then fixes causes without losing coverage. - Use Case: A developer notices pnpm test:extensions takes too long. The Skill profiles plugin import memory, identifies a broad plugin-sdk barrel loaded by every plugin-inspector run, moves static metadata into a lightweight artifact, and re-benchmarks to confirm the gain. ## Quick Start Use the openclaw-test-performance skill to benchmark the slowest OpenClaw test files, find the root cause, and report before-and-after wall time and RSS numbers.

Frequently Asked Questions about openclaw-test-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I benchmark slow Vitest test files in OpenClaw?

Run a scoped file with `/usr/bin/time -l pnpm test <file> --maxWorkers=1 --reporter=verbose` to capture wall time, CPU, and max RSS. For full-suite ranking, use `pnpm test:perf:groups --full-suite --allow-failures --output <file>`.

How to find slow module imports in Vitest tests?

Set `OPENCLAW_VITEST_IMPORT_DURATIONS=1` and `OPENCLAW_VITEST_PRINT_IMPORT_BREAKDOWN=1` when running the test to get a per-module import breakdown. This reveals broad barrels like `api.ts` or plugin-sdk roots pulled into hot tests.

How do I profile plugin import memory usage?

Run `pnpm build` followed by `pnpm test:extensions:memory -- --top 20 --json <output>` to profile bundled plugin import memory. Target specific plugins with `--extension <id>` flags and `--skip-combined` for focused measurements.

Why does RSS keep growing during OpenClaw test runs?

RSS growth can come from real leaks, retained module graphs, or per-test fresh imports via `vi.resetModules()`. Do not call it a leak until heap snapshots or retainer analysis support it; escalate with the heap-snapshot environment variables documented in the workflow.

When should I use Testbox instead of local benchmarking?

Use Crabbox-backed Blacksmith Testbox for broad or package-heavy plugin proof where local CPU noise skews results. Reuse the same `tbx_...` id across runs so before-and-after comparisons stay comparable.