perf-engineering

perf-engineering is a skill for Claude Code, Codex from cass-2003/local-workflow-skill. It costs 79 tokens per session (3,212 once invoked), scanned A, original, MIT.

A guide to finding and fixing slow code, excessive memory use, slow startup, repeated database queries, and inefficient caching.

In plain words
What is it for?
It is for reviewing application startup, list loading, searches, exports, synchronization jobs, image handling, database access, and cache behavior.
Why use it?
It helps identify common performance problems before they cause slow interfaces, high resource use, or overloaded services.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for reviewing application startup, list loading, searches, exports, synchronization jobs, image handling, database access, and cache behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cass-2003/local-workflow-skill/perf-engineering
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cass-2003/local-workflow-skill --skill perf-engineering
Clone the repo
git clone --depth 1 https://github.com/cass-2003/local-workflow-skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for perf-engineering

README.md
[![agentmods](https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/perf-engineering.svg)](https://agentmods.dev/skills/cass-2003/local-workflow-skill/perf-engineering)
Your own site
<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/perf-engineering"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/perf-engineering.svg" alt="Measured on agentmods" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,212 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00079 $0.03212
Opus 5 $0.00039 $0.01606
Sonnet 5 $0.00016 $0.00642
Haiku 4.5 $0.00008 $0.00321

Measured 4d ago against content hash 2b441ec56b32, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

perf-engineering scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl http://localhost:6060/debug/pprof/goroutine?debug=1 # goroutine泄漏
skills/engineering-core/codex/perf-engineering/SKILL.md · 231 lines

How it starts

The opening of the file, as written. The whole thing — 231 lines — stays where its author put it; the contents beside it link to each section on GitHub.

性能工程技能 (Performance Engineering Skill)

快速规则(日常开发时自动加载,只需读到这里)

[性能核心清单] ① 循环内禁止IO/网络/数据库调用(N+1→批量查询) ② 列表>100条必须虚拟化/分页 ③ 启动路径禁止同步网络请求 [内存三禁] ❌循环引用(闭包捕获self/delegate强引用) ❌大图不压缩直接加载 ❌无限缓存无淘汰策略 [缓存铁律] 读多写少=Cache+TTL+主动失效,写多读少=不缓存,❌缓存带认证的个人数据到公共层

写/改涉及性能的代码时,强制遵守:

  1. N+1检测:循环内有数据库查询/网络请求/文件IO→必须改为批量操作。Grep for/forEach/map 内的查询调用
  2. 列表性能:数据量>100条→虚拟化(LazyVStack/RecyclerView/虚拟滚动);>1000条→必须分页+游标
  3. 图片优化:必须懒加载+适当分辨率+缓存。大图(>1MB)必须压缩/缩略图。禁止主线程解码大图(解码大图耗时可达数百毫秒,主线程阻塞>16ms就掉帧)
  4. 启动优化:启动路径上禁止同步网络请求/大文件读取/重计算(启动超过3秒用户感知卡死,同步操作直接阻塞主线程)。能延迟的延迟,能异步的异步
  5. 内存管理:闭包捕获检查循环引用(Swift用[weak self]),定时器/观察者必须在deinit中取消
  6. 缓存策略:明确TTL+最大容量+淘汰策略(LRU)。写入时清除相关缓存。❌无限增长的缓存
  7. 主线程保护:IO/网络/重计算禁止在主线程(主线程阻塞>16ms就掉帧,>3s用户感知卡死)。UI更新必须在主线程。检查DispatchQueue.main使用正确性
  8. 批量操作:批量写入有数量上限(防OOM),大数据处理用流式/分批,❌一次加载全部到内存

完整审查流程(手动 /perf-engineering 或专项审查时执行)

Phase 1: 性能现状扫描

  1. 识别性能关键路径:

    • 应用启动流程(从main到首屏可交互)
    • 核心用户操作(最频繁的3-5个操作)
    • 数据密集操作(列表加载/搜索/导出/同步)
    • 后台任务(定时同步/推送处理/数据清理)
  2. 扫描性能风险模式(Grep搜索):

    • 循环内的IO/网络/数据库调用
    • DispatchQueue.main.sync(主线程死锁风险)
    • 大数据量无分页的查询
    • 未使用缓存的重复计算/请求
    • 图片加载无压缩/无缓存

Phase 2: CPU性能审查

  1. 计算密集型操作:

    • 排序/过滤/搜索算法复杂度是否合理(O(n²)→O(n log n))
    • 正则表达式是否有灾难性回溯风险
    • JSON解析/序列化是否在主线程
    • 加密/哈希操作是否阻塞UI
  2. 主线程占用:

    • Grep所有主线程操作,识别耗时操作
    • 文件IO/数据库查询/网络请求是否在后台线程
    • UI更新是否批量处理(而非逐个刷新)
    • 动画帧率是否受后台任务影响

Phase 3: 内存性能审查

  1. 内存泄漏检测模式:

    • 循环引用:闭包捕获self/delegate强引用/Timer持有target
    • 未释放资源:未关闭的文件句柄/数据库连接/网络会话
    • 观察者泄漏:NotificationCenter/KVO未移除观察者
    • 缓存无限增长:内存缓存无最大容量限制/无淘汰策略
  2. 内存使用优化:

    • 大数据集是否用分页/流式处理(而非全部加载到内存)
    • 图片是否按显示尺寸缩放(而非加载原图)
    • 临时大对象是否用autoreleasepool(ObjC/Swift)
    • 是否有不必要的数据副本(值类型大对象频繁复制)

Phase 4: IO与网络性能

  1. 网络优化:

    • 请求合并:相同数据的多个请求→合并为一个
    • 预取策略:用户即将需要的数据提前加载
    • 压缩:请求/响应是否启用gzip/brotli
    • 连接复用:HTTP/2/Keep-Alive/WebSocket长连接
    • 超时设置:连接超时/读超时/总超时是否合理
  2. 磁盘IO优化:

    • 写入合并:高频小写入→批量写入
    • 读取缓存:频繁读取的文件→内存缓存
    • 序列化格式:JSON vs Protobuf vs SQLite(按场景选择)
    • 文件大小:配置文件/缓存文件是否有大小限制

Read the full file on GitHub · 231 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 231 lines · 79 tokens per session scan A 2b441ec56b32

Subscribe to this mod's changes

perf-engineering is a skill published in the GitHub repository cass-2003/local-workflow-skill (12 stars, last pushed 2mo ago), licensed MIT. It adds 79 tokens to every session and 3,212 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

qdrant-monitoring-debugging

Diagnoses Qdrant production issues using metrics and observability tools. Use when someone reports 'optimizer stuck', 'indexing too slow', 'memory too high', 'OOM crash', 'queries are slow', 'latency spike', or 'search was fast now it's slow'. Also use when performance degrades without obvious config changes.

qdrant/skills · 75 tokens

performance

Use when optimizing application performance — caching strategies, eager loading, query optimization, Redis patterns, or background job design.

event4u-app/agent-config · 25 tokens

stale-derived-state

Diagnose a change that does not take effect until a reload, a logout or a navigation away and back, because a cache or a piece of derived state has no invalidation hook on write. Use when a save appears to work but the screen keeps showing the old value. Names the Crumbtrail queries that prove the write landed, and…

CrumbtrailDev/crumbtrail-cli · 85 tokens

redis-observability

Redis observability guidance — which metrics to monitor (memory, connections, hit ratio, ops/sec, rejected connections), which built-in commands to reach for during incident triage (SLOWLOG, INFO, MEMORY DOCTOR, CLIENT LIST, FT.PROFILE), and when to use the Redis Insight GUI. Use when setting up monitoring or alerts…

redis/agent-skills · 106 tokens

performance-optimization-skill

Identify and fix performance bottlenecks — profiling, caching (Redis, CDN, memoization), bundle size, lazy loading, N+1 detection, memory leaks.

darellchua2/opencode-config-template · 39 tokens

audit-caching

Caching correctness checklist. Use when reviewing caches — keys missing a user/tenant dimension, stale data after writes, cache stampede, cached errors, or per-user responses landing in a shared or CDN cache.

danygiguere/audit-skills · 45 tokens