benchmark-hotpath
Add performance benchmarks to hot-path functions that run on every state update (settings, auth, etc.) to establish baselines and catch regressions
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add performance benchmarks to hot-path functions that run on every state update (settings, auth, etc.) to establish baselines and catch regressions
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Systematically reduce Go function cost below the 80-unit inlining budget for hot-path performance
When updating AGENTS.md or after any dependency changes, cross-reference package.json versions against AGENTS.md to ensure accuracy
Orchestrator-only workflow for heavy coding sessions, multi-phase implementation, and risky refactors. Use for complex work that needs planning, review gates, and persistent progress tracking.
Configure and improve oh-my-opencode-slim for the current user. Use when users want to tune agents, models, prompts, custom agents, skills, MCPs, presets, or plugin behavior. Also use when recurring workflow friction suggests a safe config or prompt improvement.
基于 SOC 职业分类
| name | benchmark-hotpath |
| description | Add performance benchmarks to hot-path functions that run on every state update (settings, auth, etc.) to establish baselines and catch regressions |
Hot-path functions in this codebase (like diffObjects, fetch, store operations) run on every state update. Establish performance baselines with Jest benchmarks.
Identify the function — find where it's called frequently (search for usage patterns, check state updates).
Create benchmark file — add a new describe('X benchmarks') block to the existing test file (e.g., utils/__tests__/diff.test.ts).
Design test scenarios — cover these categories:
Set iteration counts — choose iterations so each test completes in ~20-50ms:
Use performance.now() — measure elapsed time, assert it's under 500ms (sanity check).
Run with filter — bun jest diff --testNamePattern="benchmarks"
describe('diffObjects benchmarks', () => {
describe('primitive throughput', () => {
it('primitives (same value)', () => {
const a = 42;
const b = 42;
const iterations = 1_000_000;
const start = performance.now();
for (let i = 0; i < iterations; i++) {
diffObjects(a, b);
}
const elapsed = performance.now() - start;
expect(elapsed).toBeLessThan(500); // sanity: should be fast
});
});
});
--testNamePattern="benchmarks" to run only benchmarks