convex-performance-audit

Diagnoses and fixes Convex performance issues across reads, subscriptions, OCC conflicts, and function limits.

Updated May 28, 2026
One-click install
npx skills add https://github.com/mrisoli/pokerhouse --skill convex-performance-audit-mrisoli
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-performance-audit
Source: https://github.com/mrisoli/pokerhouse/tree/main/packages/backend/.agents/skills/convex-performance-audit
Command: npx skills add https://github.com/mrisoli/pokerhouse --skill convex-performance-audit-mrisoli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Convex applications can become slow or expensive due to read amplification, excessive reactive subscriptions, write contention causing OCC conflicts, and functions hitting execution or transaction limits. This Skill provides a structured audit workflow that gathers real signals from Convex insights, routes them to the correct problem class, and applies proven fix patterns. ## Core Features & Use Cases - Signal-driven diagnosis: Starts from npx convex insights --details, dashboard health data, or a code audit to identify the actual problem class before changing anything. - Four reference playbooks: Covers hot-path read amplification and indexes, OCC conflict resolution, subscription cost reduction, and function budget limits, each with concrete code examples and a recommended fix order. - Sibling consistency checks: Ensures that when one function is fixed, sibling readers and writers touching the same tables are audited for the same pattern. - Use Case: A team notices high bytes-read in Convex insights on their project list page. The Skill traces the query, finds JavaScript-side filtering instead of an index, recommends a compound index, and checks sibling list queries for the same anti-pattern. ## Quick Start Ask the assistant to audit your Convex app for performance issues, starting with the strongest available signal such as insights output or a slow page.

Frequently Asked Questions about convex-performance-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose slow Convex queries?▼

Start by running npx convex insights --details to find functions with high bytes read or documents read. Then trace every ctx.db.get and ctx.db.query in the affected path, looking for JavaScript-side filtering, unbounded collect calls, and unnecessary joins.

How do I fix OCC conflicts in Convex mutations?▼

OCC conflicts come from write contention on hot documents or broad read sets. Narrow reads with indexes, split hot documents like shared counters into shards, and move non-critical bookkeeping to scheduled functions via ctx.scheduler.runAfter.

Does Convex .filter() use indexes?▼

No, the Convex .filter() method performs the same work as filtering in JavaScript and does not push predicates to the storage layer. Only .withIndex() and .withSearchIndex() actually reduce the documents scanned.

How do I reduce Convex subscription costs?▼

Reduce subscription cost by using point-in-time reads for low-freshness flows, batching related data into fewer queries, using skip for conditional subscriptions, and isolating frequently-updated fields like lastSeen into separate documents.

What are the Convex function execution limits?▼

Queries and mutations have 1 second of user-code execution time, 16 MiB read and write per transaction, and 32,000 documents scanned per transaction. Actions get 10 minutes and should handle heavy computation or external API calls.

When should I not restructure my Convex schema for performance?▼

Avoid digest tables, document splitting, or migration-heavy rollouts when scale is small, traffic is modest, or signals are weak. A simple scan on a small table is often acceptable, and structural work should follow a measured signal.