performance

Detect and fix N+1 queries, slow queries, and memory leaks in Rails.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/reckerswartz/resume_builder --skill performance-reckerswartz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance
Source: https://github.com/reckerswartz/resume_builder/tree/main/.devin/skills/performance
Command: npx skills add https://github.com/reckerswartz/resume_builder --skill performance-reckerswartz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identifies and fixes Rails performance issues including N+1 queries, slow queries, and memory problems. Use when optimizing queries, fixing N+1 issues, improving response times, or working with the Bullet gem.

Core Features & Use Cases

  • N+1 Detection: Identify and prevent N+1 queries via Bullet and eager loading.
  • Query Optimization: Optimize slow queries and add appropriate indexes.
  • Memory Management: Profile and mitigate memory bloat, tracking allocations.

Example: In a large Rails app, use this skill to locate hotspots and apply fixes to reduce response times.

Quick Start

Enable Bullet, rack-mini-profiler, and memory_profiler in development and run the app to surface N+1 queries and memory hotspots.

Frequently Asked Questions about performance

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

FAQPage Schema
How do I detect and fix N+1 queries in a Rails application?

To fix Rails N+1 queries, enable the Bullet gem in development to surface inefficient eager loading, then apply targeted optimization strategies like adding includes or preload to reduce database queries across models, controllers, and views.

What is the best way to profile memory bloat and track allocations in Rails?

Profiling Rails memory bloat involves using the memory_profiler gem to track object allocations and identify hotspots in your application code, enabling you to apply targeted mitigation strategies and reduce overall memory consumption.

How do I use rack-mini-profiler to find slow queries in Rails?

Using rack-mini-profiler to find slow Rails queries requires enabling the gem in your development environment, which surfaces query execution times and performance hotspots directly in your browser for end-to-end optimization analysis.

Does this Rails performance optimization approach work with Rails 8?

Yes, this Rails performance optimization approach works with Rails 8, providing production-grade configuration examples for Bullet, rack-mini-profiler, and memory_profiler to detect and fix slow queries, N+1 issues, and memory leaks.

Can I use Bullet and rack-mini-profiler together in development?

Yes, you can use Bullet and rack-mini-profiler together in a Rails development environment to simultaneously detect N+1 queries via Bullet and profile response time hotspots via rack-mini-profiler for comprehensive performance optimization.

Why are my Rails controller actions slow and how do I add database indexes?

Slow Rails controller actions often stem from unoptimized database queries; adding appropriate database indexes and using query optimization strategies reduces slow query execution times and improves overall response times.