Loading...
Loading...
Benchmark, diagnose, and optimize OpenClaw test and plugin-suite runtime, import hotspots, CPU/RSS, heap growth, and slow coverage paths.
npx skill4agent add steipete/clawdis openclaw-test-performancepnpm testAGENTS.mdsrc/agents/AGENTS.mdsrc/channels/AGENTS.mdsrc/plugins/AGENTS.mdsrc/gateway/AGENTS.mdtest/helpers/AGENTS.mdtest/helpers/channels/AGENTS.mdsrc/infra/outbound/AGENTS.mdpnpm test:perf:groups --full-suite --allow-failures --output <file>pnpm test:extensions:batch <plugin[,plugin...]>/usr/bin/time -l pnpm test <file-or-files> --maxWorkers=1 --reporter=verboseOPENCLAW_VITEST_IMPORT_DURATIONS=1 OPENCLAW_VITEST_PRINT_IMPORT_BREAKDOWN=1scripts/committer "<message>" <paths...>pnpm test extensions/<id>pnpm test:extensions:batch <id>pnpm run test:extensions:package-boundary:canarypnpm run test:extensions:package-boundary:compilepnpm test:extensionspnpm test:extensions:memory -- --json .artifacts/test-perf/extensions-memory.jsonplugin-inspectortest:extensions:batchpnpm test:extensionsblacksmith testbox warmup ci-check-testbox.yml --ref main --idle-timeout 90blacksmith testbox run --id <ID> "OPENCLAW_TESTBOX=1 pnpm test:extensions:batch <ids>"openclaw-pre-release-plugin-testingtbx_...| Metric | Use for | Preferred source |
|---|---|---|
| wall time | user-visible suite cost | |
| Vitest duration | test body/import cost | Vitest output per file/shard |
| import duration | broad barrel/runtime loads | |
| max RSS | memory pressure and OOM risk | |
| CPU/user/sys | CPU-bound vs wait-bound split | |
| heap snapshots | real leak vs retained module graph | |
timeout 240 /usr/bin/time -l pnpm test <file> --maxWorkers=1 --reporter=verbosepnpm build
pnpm test:extensions:memory -- --top 20 --json .artifacts/test-perf/extensions-memory.jsonpnpm test:extensions:memory -- --extension discord --extension telegram --skip-combinedOPENCLAW_TEST_MEMORY_TRACE=1 \
OPENCLAW_TEST_HEAPSNAPSHOT_INTERVAL_MS=60000 \
OPENCLAW_TEST_HEAPSNAPSHOT_DIR=.tmp/heapsnap \
OPENCLAW_TEST_WORKERS=2 \
OPENCLAW_TEST_MAX_OLD_SPACE_SIZE_MB=6144 \
pnpm testopenclaw-test-heap-leaksgetChannelPlugin()api.tsruntime-api.tstest-api.tsimportActual()vi.resetModules()beforeAllafterEachtest/fixtures/test-timings.unit.jsonnode_modules/.experimental-vitest-cacheOPENCLAW_VITEST_FS_MODULE_CACHE_PATHtimeout 240 /usr/bin/time -l pnpm test <file> --maxWorkers=1 --reporter=verbosetimeout 240 /usr/bin/time -l env \
OPENCLAW_VITEST_IMPORT_DURATIONS=1 \
OPENCLAW_VITEST_PRINT_IMPORT_BREAKDOWN=1 \
pnpm test <file> --maxWorkers=1 --reporter=verbosepnpm test:perf:groups --full-suite --allow-failures \
--output .artifacts/test-perf/<name>.jsonpnpm test:extensions:batch <plugin[,plugin...]> -- --reporter=verbosepnpm test:extensionspnpm run test:extensions:package-boundary:canary
pnpm run test:extensions:package-boundary:compilepnpm test:perf:groups --report <vitest-json> \
--output .artifacts/test-perf/<name>.jsonpnpm check:changedpnpm test:changedpnpm buildpnpm plugin-sdk:api:checkpnpm plugin-sdk:api:genpnpm install| Metric | Before | After | Gain |
| -------------- | -----: | -----: | ------------: |
| File wall time | `Xs` | `Ys` | `-Zs` (`P%`) |
| Max RSS | `XMB` | `YMB` | `-ZMB` (`P%`) |
| CPU user/sys | `X/Ys` | `A/Bs` | explain |