performance-optimization

Diagnose and fix frontend, backend, and database performance bottlenecks through measurement-driven workflows.

Updated Apr 28, 2026
One-click install
npx skills add https://github.com/visdomtech/skills --skill performance-optimization-visdomtech
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/visdomtech/skills/tree/main/performance-optimization
Command: npx skills add https://github.com/visdomtech/skills --skill performance-optimization-visdomtech

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow applications lose users, but optimizing without measurement wastes effort on the wrong things. This Skill provides a structured measure-identify-fix-verify-guard workflow for finding and fixing real performance bottlenecks across frontend rendering, backend APIs, and database queries. ## Core Features & Use Cases - Measurement-First Workflow: Establish baselines with synthetic tools (Lighthouse, DevTools) and real user monitoring (web-vitals, CrUX) before changing any code. - Anti-Pattern Fixes: Concrete before/after code for N+1 queries, unbounded fetching, connection pool exhaustion, missing image optimization, unnecessary React re-renders, large bundles, and missing caching. - Regression Guarding: Set performance budgets, enforce them in CI with bundlesize and Lighthouse CI, and log every attempt so failed ideas are not retried. - Use Case: Your API endpoints suddenly feel slow. Use this Skill to profile database queries with EXPLAIN ANALYZE, discover an N+1 pattern in the task listing endpoint, fix it with a single joined query, and verify the p95 latency improvement before committing. ## Quick Start Use the performance-optimization skill to profile my app's slow dashboard page and identify the actual bottleneck before suggesting fixes.

Frequently Asked Questions about performance-optimization

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

FAQPage Schema
How do I fix N+1 queries in my backend API?▼

Fix N+1 queries by replacing per-record lookups with a single query using a join or include clause, such as findMany with include in an ORM. Confirm the fix by checking the database query log before and after the change.

How to improve Core Web Vitals scores like LCP and INP?▼

Improve Core Web Vitals by first measuring with Lighthouse and the web-vitals library, then targeting the failing metric: optimize hero images and render-blocking resources for LCP, reduce main-thread long tasks for INP, and set explicit image dimensions for CLS.

When should I add a database index for a slow query?▼

Add an index only after running EXPLAIN ANALYZE and reading the query plan. Index for the shape of the query with equality columns first, and skip indexing for low-selectivity filters, leading wildcards, or write-heavy tables where the write cost outweighs read gains.

Why are all my API endpoints slow at the same time?▼

Simultaneous slowness across all endpoints is the signature of connection pool exhaustion, where requests wait for connections rather than execute. Use one pool per process sized against the database limit, and add a proxy like pgbouncer for serverless or autoscaling environments.

Should I cache a slow database query with Redis?▼

Cache only data that is expensive to produce and read far more often than it changes. Include every input that affects the response in the cache key, pick one invalidation strategy such as TTL or versioned keys, and never cache data where staleness is a correctness bug.

When should I not optimize application performance?▼

Do not optimize before you have profiling evidence of a real problem. Premature optimization adds complexity that costs more than the performance it gains, and changes that show no measurable improvement over baseline should be reverted rather than kept.