<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/get-in-human-cut-rails-boot-time-with-require-profiler-and-this-guide-martian-chronicles-evil-mar-xwe166tlh" -->

---
title: Get in, human: cut Rails boot time with require-profiler...
description: A deep technical walkthrough on cutting Rails boot times, centered on require-profiler, a new tool that traces Ruby's code loading as a tree with timings....
canonical: https://daily.dev/posts/get-in-human-cut-rails-boot-time-with-require-profiler-and-this-guide-martian-chronicles-evil-mar-xwe166tlh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Get in, human: cut Rails boot time with require-profiler and this guide—Martian Chronicles, Evil Martians’ team blog | daily.dev
og:description: A deep technical walkthrough on cutting Rails boot times, centered on require-profiler, a new tool that traces Ruby's code loading as a tree with timings....
og:url: https://daily.dev/posts/get-in-human-cut-rails-boot-time-with-require-profiler-and-this-guide-martian-chronicles-evil-mar-xwe166tlh
og:image: https://api.daily.dev/og/posts/xWe166Tlh.png
og:image:alt: Get in, human: cut Rails boot time with require-profiler and this guide—Martian Chronicles, Evil Martians’ team blog
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get in, human: cut Rails boot time with require-profiler and this guide—Martian Chronicles, Evil Martians’ team blog

**[Martian Chronicles](https://daily.dev/sources/evilmartians)** · 20 min read · 0 upvotes · 0 comments

## Summary

A deep technical walkthrough on cutting Rails boot times, centered on require-profiler, a new tool that traces Ruby's code loading as a tree with timings. Covers Bootsnap setup and precompilation, reading require-profiler output (requires, YAML parsing, HTTP calls, and Rails initialization phases), and using sampling profilers (Stackprof) for costs invisible to require tracking, like OpenSSL key generation and filesystem globbing. Real case study: Factorial's 200-component monolith cut dev boot from ~23s to ~13s (40%) and production boot by ~20%, fixing issues like Devise route reloading, lazy to_prepare hooks, and Karafka's railtie loading the whole consumer graph unnecessarily. A separate investigation into AnyCable's own boot uncovered a Ruby refinement-activation cache invalidation bug (Ruby issue #21201) fixed in Ruby 4.0, and other one-off wins like avoiding eager net/http loading and deferring test-framework patching. Ends with instructions for shipping this profiling workflow as an AI agent skill via Rails Hyperdrive.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://evilmartians.com/chronicles/get-in-human-cut-rails-boot-time-with-require-profiler-and-this-guide>

## Questions this post answers

### How do I profile Rails boot time to find what's slowing down my app's startup?

Use require-profiler, a tool that hooks Ruby's code loading process and outputs an indented tree of every require, require_relative, and load call with timings, plus plugin-based lines for YAML parsing and HTTP calls, and native rails: lines for initializers, reload callbacks, and load hooks. Run it with 'bundle exec ruby -r./config/boot -require-prof config/environment.rb', then filter noise with REQUIRE_PROFILE_THRESHOLD or zoom in with REQUIRE_PROFILE_FOCUS. For costs invisible to requires, like native code or syscalls, hand off to Stackprof via REQUIRE_PROFILE_STACKPROF.

_Developers chasing slow Rails boots can find deep-dive profiling writeups like this through daily.dev._

### Why does Devise slow down my Rails app's boot time?

By default Devise forces all application routes to be reloaded, effectively loading them twice, which adds meaningful boot overhead on route-heavy apps. Setting config.reload_routes = false in config/initializers/devise.rb fixes this; on one audited app this single change cut boot time from roughly 31 to 23 seconds. Note that disabling it means Devise mappings won't be reloaded during boot, so verify your app doesn't depend on that reload behavior.

_daily.dev surfaces practical Rails performance fixes like this for engineers optimizing deploy and CI times._

### Why is Ruby's refinement activation (using) slow on apps with many classes, and is it fixed in Ruby 4.0?

Every refinement activation invalidates method caches through a full object-space scan, so overhead grows with the number of loaded classes, adding 50% or more cost at real-app scale on Ruby 3.3 per isolated benchmarking. This is tracked as Ruby issue #21201. Ruby 4.0 fixes it with a dedicated refinement-cache table, shrinking the overhead more than ten times, with no backport planned to older Ruby versions.

_daily.dev helps Ruby developers track language internals changes like this before they hit production._

## Similar posts on daily.dev

- [TestProf Digest 2026.4: surprising finds from 30k specs—Martian Chronicles, Evil Martians’ team blog](https://daily.dev/posts/testprof-digest-2026-4-surprising-finds-from-30k-specs-martian-chronicles-evil-martians-team-blog-htcwll51r) · Martian Chronicles · 0 upvotes · 0 comments
- [From 40 Minutes to 4 With Tests Parallelization - FastRuby.io](https://daily.dev/posts/from-40-minutes-to-4-with-tests-parallelization---fastruby-io-xpan2yyce) · RUBYLAND · 0 upvotes · 0 comments
- [Curiosity reduced the heap size by 60%](https://daily.dev/posts/curiosity-reduced-the-heap-size-by-60--6fqrwxuby) · Ruby Flow · 3 upvotes · 0 comments
- [Warming up the Puma master before it forks](https://daily.dev/posts/warming-up-the-puma-master-before-it-forks-ubpjz1eku) · 37signals Dev · 2 upvotes · 0 comments
- [Rails Performance Monitoring: What to Watch and Why It Slows Down](https://daily.dev/posts/rails-performance-monitoring-what-to-watch-and-why-it-slows-down-hipvfdnw1) · Last9 · 1 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#ruby](https://daily.dev/tags/ruby), [#rails](https://daily.dev/tags/rails)

[View this post on daily.dev](https://daily.dev/posts/get-in-human-cut-rails-boot-time-with-require-profiler-and-this-guide-martian-chronicles-evil-mar-xwe166tlh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Get in, human: cut Rails boot time with require-profiler and this guide—Martian Chronicles, Evil Martians’ team blog","url":"https://daily.dev/posts/get-in-human-cut-rails-boot-time-with-require-profiler-and-this-guide-martian-chronicles-evil-mar-xwe166tlh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/get-in-human-cut-rails-boot-time-with-require-profiler-and-this-guide-martian-chronicles-evil-mar-xwe166tlh"},"datePublished":"2026-08-19T13:34:10.596Z","dateModified":"2026-08-19T13:55:14.258Z","description":"A deep technical walkthrough on cutting Rails boot times, centered on require-profiler, a new tool that traces Ruby's code loading as a tree with timings....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a583ca2075bb952bcc9b9defd486a4ac?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a583ca2075bb952bcc9b9defd486a4ac?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Martian Chronicles","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Martian Chronicles","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/6334c9de96a7414ebbf4b7667ba572c5","url":"https://daily.dev/sources/evilmartians"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/get-in-human-cut-rails-boot-time-with-require-profiler-and-this-guide-martian-chronicles-evil-mar-xwe166tlh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,ruby,rails","timeRequired":"PT20M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Martian Chronicles","item":"https://daily.dev/sources/evilmartians"},{"@type":"ListItem","position":3,"name":"Get in, human: cut Rails boot time with require-profiler and this guide—Martian Chronicles, Evil Martians’ team blog"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/get-in-human-cut-rails-boot-time-with-require-profiler-and-this-guide-martian-chronicles-evil-mar-xwe166tlh#faq","mainEntity":[{"@type":"Question","name":"How do I profile Rails boot time to find what's slowing down my app's startup?","acceptedAnswer":{"@type":"Answer","text":"Use require-profiler, a tool that hooks Ruby's code loading process and outputs an indented tree of every require, require_relative, and load call with timings, plus plugin-based lines for YAML parsing and HTTP calls, and native rails: lines for initializers, reload callbacks, and load hooks. Run it with 'bundle exec ruby -r./config/boot -require-prof config/environment.rb', then filter noise with REQUIRE_PROFILE_THRESHOLD or zoom in with REQUIRE_PROFILE_FOCUS. For costs invisible to requires, like native code or syscalls, hand off to Stackprof via REQUIRE_PROFILE_STACKPROF. Developers chasing slow Rails boots can find deep-dive profiling writeups like this through daily.dev."}},{"@type":"Question","name":"Why does Devise slow down my Rails app's boot time?","acceptedAnswer":{"@type":"Answer","text":"By default Devise forces all application routes to be reloaded, effectively loading them twice, which adds meaningful boot overhead on route-heavy apps. Setting config.reload_routes = false in config/initializers/devise.rb fixes this; on one audited app this single change cut boot time from roughly 31 to 23 seconds. Note that disabling it means Devise mappings won't be reloaded during boot, so verify your app doesn't depend on that reload behavior. daily.dev surfaces practical Rails performance fixes like this for engineers optimizing deploy and CI times."}},{"@type":"Question","name":"Why is Ruby's refinement activation (using) slow on apps with many classes, and is it fixed in Ruby 4.0?","acceptedAnswer":{"@type":"Answer","text":"Every refinement activation invalidates method caches through a full object-space scan, so overhead grows with the number of loaded classes, adding 50% or more cost at real-app scale on Ruby 3.3 per isolated benchmarking. This is tracked as Ruby issue #21201. Ruby 4.0 fixes it with a dedicated refinement-cache table, shrinking the overhead more than ten times, with no backport planned to older Ruby versions. daily.dev helps Ruby developers track language internals changes like this before they hit production."}}]}
```

