performance-check

Diagnose and resolve performance issues in PHP/Laravel applications.

Updated Jul 13, 2023
One-click install
npx skills add https://github.com/changgenglu/changgenglu-blog --skill performance-check-changgenglu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-check
Source: https://github.com/changgenglu/changgenglu-blog/tree/main/prompt_engineering/agents/skills/performance-check
Command: npx skills add https://github.com/changgenglu/changgenglu-blog --skill performance-check-changgenglu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides guidelines for diagnosing and addressing performance issues in PHP/Laravel applications, focusing on database queries, memory management, and caching strategies.

Core Features & Use Cases

  • N+1 query detection and remediation guidance: identify common patterns and recommended fixes.
  • Large data set handling and pagination guidance: avoid loading everything into memory and implement efficient paging.
  • Caching strategy evaluation: assess cache keys, TTLs, and invalidation practices.
  • Use Case: For a Laravel app with slow API responses, use this skill to pinpoint slow queries and propose optimizations.

Quick Start

Run a focused performance audit on a Laravel project to surface bottlenecks and recommended optimizations.

Frequently Asked Questions about performance-check

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

FAQPage Schema
How do I detect and fix N+1 query issues in Laravel?

To fix N+1 query issues in Laravel, you apply eager loading patterns to replace repetitive single-record fetches with a single batched query. This reduces database load and significantly speeds up API response times.

What is the best way to handle large data loads and prevent memory exhaustion in PHP applications?

Handling large data loads in PHP requires implementing efficient pagination and chunked processing to avoid loading entire datasets into memory. This prevents memory exhaustion and maintains stable application performance.

How do I evaluate and improve my Laravel caching strategy?

To evaluate your Laravel caching strategy, you analyze cache keys, TTL configurations, and invalidation practices to ensure efficient data retrieval. Proper cache management minimizes redundant database queries and optimizes memory usage.

Why does my Laravel API respond slowly and how can I optimize it?

Slow Laravel API responses often stem from unoptimized database queries, missing indexes, or cache inefficiencies. You can pinpoint these bottlenecks by running a focused performance audit to surface and resolve query delays.