跳到正文
Skillpedia
API 与服务器(后端)9.5k · #12253

convex-performance-audit

它能做什么

这个技能会诊断 Convex 应用中缓慢或高成本的部分,并逐个问题加以修复。适合应用感觉变慢,或用量报告显示大量数据读取的开发者。

适用场景

  • ✓当你的 Convex 应用中某个页面或功能感觉很慢时。
  • ✓当用量报告显示某个函数读取的数据远超预期时。
  • ✓当你的应用因大量同时更新而出现写入冲突错误时。

技能链接

https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-performance-audit/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-performance-audit/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的 Convex 控制台页面加载很慢。请找出原因并修复慢的部分。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会从部署或代码中收集性能数据,找出最明显的信号,并应用适合该问题的最简单修复。除非数据表明确实需要,否则它会避免大规模重构。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Convex Performance Audit

Diagnose and fix performance problems in Convex applications, one problem class at a time.

When to Use

  • A Convex page or feature feels slow or expensive
  • npx convex insights --details reports high bytes read, documents read, or OCC conflicts
  • Low-freshness read paths are using reactivity where point-in-time reads would do
  • OCC conflict errors or excessive mutation retries
  • High subscription count or slow UI updates
  • Functions approaching execution or transaction limits
  • The same performance pattern needs fixing across sibling functions

When Not to Use

  • Initial Convex setup, auth setup, or component extraction
  • Pure schema migrations with no performance goal
  • One-off micro-optimizations without a user-visible or deployment-visible problem

Guardrails

  • Prefer simpler code when scale is small, traffic is modest, or the available signals are weak
  • Do not recommend digest tables, document splitting, fetch-strategy changes, or migration-heavy rollouts unless there is a measured signal, a clearly unbounded path, or a known hot read/write path
  • In Convex, a simple scan on a small table is often acceptable. Do not invent structural work just because a pattern is not ideal at large scale

First Step: Gather Signals

Start with the strongest signal available:

  1. If deployment Health insights are already available from the user or the current context, treat them as a first-class source of performance signals.
  2. If CLI insights are available, run npx convex insights --details. Use --prod, --preview-name, or --deployment-name when needed.
    • If the local repo's Convex CLI is too old to support insights, try npx -y convex@latest insights --details before giving up.
  3. If the repo already uses convex-doctor, you may treat its findings as hints. Do not require it, and do not treat it as the source of truth.
  4. If runtime signals are unavailable, audit from code anyway, but keep the guardrails above in mind. Lack of insights is not proof of health, but it is also not proof that a large refactor is warranted.

Signal Routing

After gathering signals, identify the problem class and read the matching reference file.

Signal Reference
High bytes or documents read, JS filtering, unnecessary joins references/hot-path-rules.md
OCC conflict errors, write contention, mutation retries references/occ-conflicts.md
High subscription count, slow UI updates, excessive re-renders references/subscription-cost.md
Function timeouts, transaction size errors, large payloads references/function-budget.md
General "it's slow" with no specific signal Start with references/hot-path-rules.md

Multiple problem classes can overlap. Read the most relevant reference first, then check the others if symptoms remain.

Escalate Larger Fixes

If the likely fix is invasive, cross-cutting, or migration-heavy, stop and present options before editing.

Examples:

  • introducing digest or summary tables across multiple flows
  • splitting documents to isolate frequently-updated fields
  • reworking pagination or fetch strategy across several screens
  • switching to a new index or denormalized field that needs migration-safe rollout

When correctness depends on handling old and new states during a rollout, consult the convex-migration-helper skill for the migration workflow.

Workflow

1. Scope the problem

Pick one concrete user flow from the actual project. Look at the codebase, client pages, and API surface to find the flow that matches the symptom.

Write down:

  • entrypoint functions
  • client callsites using useQuery, usePaginatedQuery, or useMutation
  • tables read
  • tables written
  • whether the path is high-read, high-write, or both

2. Trace the full read and write set

For each function in the path:

  1. Trace every ctx.db.get() and ctx.db.query()
  2. Trace every ctx.db.patch(), ctx.db.replace(), and ctx.db.insert()
  3. Note foreign-key lookups, JS-side filtering, and full-document reads
  4. Identify all sibling functions touching the same tables
  5. Identify reactive stats, aggregates, or widgets rendered on the same pag
常见问题

它会重建我的整个数据结构吗?

不会。除非有实际测量的证据或明显无界的读取路径,否则它会避免大的结构性改动。

它使用哪些信号?

在修改代码之前,它会先使用可用的最强信号,例如部署健康洞察。

小表扫描总是问题吗?

不一定。在小表上,简单的扫描通常是可以接受的,技能不会为此凭空增加工作。

详情

作者的原始描述

Audits Convex performance for reads, subscriptions, write contention, and function limits. Use for slow features, insights findings, OCC conflicts, or read amplification.

repo: openclaw/clawhub

热度

GitHub 星标
9.5k
排名
#12253
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能