performance-optimization

Diagnose and optimize Rails query performance and memory usage.

643|80|Updated Dec 9, 2025
One-click install
npx skills add https://github.com/ThibautBaissac/rails_ai_agents --skill performance-optimization-thibautbaissac
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/ThibautBaissac/rails_ai_agents/tree/main/skills/performance-optimization
Command: npx skills add https://github.com/ThibautBaissac/rails_ai_agents --skill performance-optimization-thibautbaissac

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rails performance tuning and optimization to prevent slow queries, memory bloat, and N+1 issues.

Core Features & Use Cases

  • Detect and fix N+1 queries with eager loading strategies and query optimization.
  • Profile memory usage and identify hot spots to reduce allocations.
  • Provide actionable guidelines for indexing, batching, and query analysis in Rails apps.

Quick Start

Enable Bullet and Rack Mini Profiler in development to detect N+1 queries and memory issues.

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 Rails?

To fix N+1 queries in Rails, apply eager loading strategies like includes or preload to fetch associations in a single query. This Skill provides actionable guidelines for detection and query optimization using Bullet to identify and resolve these issues.

What's the best way to profile memory usage and identify hot spots in a Rails app?

The best way to profile memory usage in a Rails app is enabling Rack Mini Profiler to identify memory bloat and allocation hot spots. This Skill guides you through profiling memory usage to reduce allocations and optimize performance.

How do I detect slow queries and memory bloat in Rails staging environments?

You can detect slow queries and memory bloat in Rails staging by enabling Bullet and Rack Mini Profiler. This Skill applies to development, staging, and production environments to diagnose slow query performance and memory issues.

Does this Rails performance optimization guidance cover database indexing and batch processing?

Yes, this Rails performance optimization guidance covers database indexing and batch processing. It provides actionable guidelines for indexing, batching, and query analysis to resolve slow queries and reduce memory bloat.

Why does my Rails app have memory bloat and how can I reduce allocations?

Your Rails app may have memory bloat due to inefficient query loading and excessive object allocations. This Skill helps profile memory usage, identify hot spots, and implement batch processing and eager loading to reduce memory bloat.