performance-optimization

Diagnose and fix frontend and backend performance bottlenecks using measurement-driven profiling workflows.

5|Updated Mar 5, 2024
One-click install
npx skills add https://github.com/TRAPZZY/God-Eyes --skill performance-optimization-trapzzy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/TRAPZZY/God-Eyes/tree/main/.skills/performance-optimization
Command: npx skills add https://github.com/TRAPZZY/God-Eyes --skill performance-optimization-trapzzy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow page loads, sluggish interactions, and lagging APIs frustrate users and hurt conversions, but optimizing without data wastes effort on the wrong things. This Skill enforces a measure-first workflow so you fix the actual bottleneck instead of guessing. ## Core Features & Use Cases - Measurement-First Workflow: Follow a five-step process (Measure, Identify, Fix, Verify, Guard) with concrete profiling commands for frontend and backend. - Core Web Vitals Guidance: Target thresholds for LCP, INP, and CLS with symptom-to-cause decision trees for diagnosing slow loads, jank, and high latency. - Anti-Pattern Fixes with Code Examples: Ready-to-apply fixes for N+1 queries, unbounded fetching, unoptimized images, unnecessary React re-renders, large bundles, and missing caching. - Use Case: Your React app's dashboard feels sluggish after a release. Use this Skill to profile long tasks, identify an N+1 query in the data-fetching layer, apply the join-based fix, and verify the improvement against your performance budget in CI. ## Quick Start Profile my application's slow dashboard page, identify the bottleneck, and apply the appropriate performance fix with before-and-after measurements.

Frequently Asked Questions about performance-optimization

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

FAQPage Schema
How do I improve Core Web Vitals scores like LCP and INP?▼

Improve Core Web Vitals by first measuring with Lighthouse or the web-vitals library, then targeting the specific bottleneck. For LCP, optimize images and render-blocking resources; for INP, reduce long tasks on the main thread; for CLS, set explicit image dimensions.

How to fix N+1 query problems in backend APIs?▼

Fix N+1 queries by replacing per-record lookups with a single query using joins or ORM include statements. For example, use findMany with an include clause instead of looping through results and querying each related record individually.

When should I use React.memo and useMemo for performance?▼

Use React.memo for expensive child components that re-render unnecessarily and useMemo for costly computations tied to specific dependencies. Overusing them adds overhead, so only apply them after profiling confirms a re-render bottleneck.

Why is premature optimization discouraged in performance work?▼

Premature optimization adds complexity without proven benefit because it targets assumed bottlenecks rather than measured ones. Always establish a baseline with real profiling data, fix the identified bottleneck, and verify improvement with follow-up measurements.

How do I enforce a performance budget in CI?▼

Enforce performance budgets in CI using bundlesize to check JavaScript bundle limits and Lighthouse CI (lhci autorun) to validate performance scores. Set concrete budgets such as under 200KB gzipped JavaScript and a Lighthouse score of at least 90.