# Performance Work

Find and remove waste in slow OpenClaw flows before adding any cache.

- Repository: https://github.com/openclaw/openclaw (393636 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add openclaw/openclaw --skill openclaw-performance -g -a claude-code -y`
Codex: `npx skills add openclaw/openclaw --skill openclaw-performance -g -a codex -y`
Cursor: `npx skills add openclaw/openclaw --skill openclaw-performance -g -a cursor -y`
Gemini CLI: `npx skills add openclaw/openclaw --skill openclaw-performance -g -a gemini-cli -y`

## Description

Performance work in OpenClaw: a slow or heavy flow (latency, CPU, memory, SQL, RPC, renders), writing or reviewing a perf PR, or adding a cache. Count the work, delete waste first, cache last.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# OpenClaw Performance

**Waste** is work a request does not need. Big speedups come from deleting waste, not from doing the same work faster. A cache is the last resort: it hides waste until its key, invalidation or hit rate breaks, and the waste returns.

## 1. Measure

Write the acceptance rule in the PR **before** the first run: flow, workload, metric, cold or warm, samples, and the change that counts as a win or a regression.

| Flow                            | Committed workload                                                                                                   |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| CLI startup                     | `pnpm test:startup:bench` (`:check` holds the budget)                                                                |
| Gateway startup / restart       | `scripts/bench-gateway-startup.ts`, `scripts/bench-gateway-restart.ts`, `scripts/perf/post-restart-burst-measure.ts` |
| Chat turn, frames per turn      | `scripts/bench-channel-turn.mts`, `scripts/perf/transcript-broadcast-measure.ts`                                     |
| Control UI cold load            | `scripts/bench-control-ui-cold-load.ts`, `pnpm ui:check-performance` (`:base` compares)                              |
| Control UI older-history paging | `scripts/bench-control-ui-history-depth.ts`                                                                          |
| Session list, multi-agent shape | `scripts/perf/team-shape-fixture.ts`, `src/gateway/session-list-viewers.perf.test.ts`                                |
| Concurrency, SQLite state       | `scripts/bench-gateway-concurrency.ts`, `pnpm test:sqlite:perf`                                                      |

The rest: https://github.com/openclaw/openclaw/blob/HEAD/.agents/skills/openclaw-performance/SKILL.md
