performance-patterns

Detect performance anti-patterns across database, backend, frontend, and API layers.

2|1|Updated Dec 17, 2025
One-click install
npx skills add https://github.com/hculap/better-code --skill performance-patterns-hculap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-patterns
Source: https://github.com/hculap/better-code/tree/main/plugins/n1-optimizer/skills/performance-patterns
Command: npx skills add https://github.com/hculap/better-code --skill performance-patterns-hculap

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use when user asks about N+1 queries, performance optimization, query optimization, reduce API calls, improve render performance, fix slow code, optimize database, or reduce bundle size. Provides guidance on identifying and fixing performance anti-patterns across database, backend, frontend, and API layers.

Core Features & Use Cases

  • N+1 Query Problems: Detection and fixes across data layers.
  • Over-/Under-Fetching: Strategies to minimize data transfer.
  • Pagination & Efficiency: Recommendations for efficient data retrieval.
  • Frontend & API: Guidance on rendering efficiency and API request patterns.

Quick Start

Run the analyzer to scan your codebase with /n1-optimizer:analyze and review findings.

Frequently Asked Questions about performance-patterns

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

FAQPage Schema
How do I identify and fix N+1 query problems in my database?

N+1 queries occur when a single query triggers multiple additional queries in a loop, drastically slowing performance. Use eager loading, batching, or DataLoader to fetch related data in one or two queries instead of N+1 separate calls.

What's the best way to optimize API responses to reduce over-fetching and under-fetching?

Over-fetching returns excess data; under-fetching requires multiple requests. Use field selection, DTOs (Data Transfer Objects), and pagination to return precisely the data clients need in a single efficient request.

How do I detect performance bottlenecks across frontend and backend layers?

Performance anti-patterns span database queries, API design, and frontend rendering. Scan for N+1 queries, missing pagination, inefficient algorithms, unnecessary re-renders, and sequential async operations to pinpoint slowdowns across all layers.

What techniques reduce unnecessary re-renders and improve frontend performance?

Memoization prevents redundant re-renders by caching component results. Combine with pagination and efficient API request patterns to minimize data transfer and rendering overhead on the client side.

When should I implement pagination in my API endpoints?

Pagination is essential when datasets grow large or APIs serve many clients. It reduces memory usage, speeds up response times, and prevents timeouts by retrieving data in manageable chunks rather than all at once.

Can I parallelize sequential async operations to improve performance?

Sequential async operations waste time waiting unnecessarily. Parallelization executes independent operations concurrently, reducing overall execution time and improving throughput across backend services and API layers.