Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8742063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:26:01+00:00 2026-06-13T11:26:01+00:00

This is a bit of a follow-up from a previous question on improving rails

  • 0

This is a bit of a follow-up from a previous question on improving rails console loading time.

The first great suggestion was to figure out which gems take too long.

Next answer, suggested using :require => nil and loading those gems later.

With some gems however, it’s not entirely clear how to accomplish this without breaking things. Here’s a list of our ‘biggest offenders’, I wonder if someone can suggest the best approach to loading them only when necessary?

require gon: 2.730000 (2.870059)
require omniauth-openid: 1.410000 (1.503858)
require cancan: 2.640000 (2.707467)
require fog: 2.730000 (2.846530)
require activeadmin: 3.650000 (3.923877)

and of course there are many more that take around 1 second or less, which also adds up… but at least removing the big ones will already improve things.

how can I selectively load gems later to make rails load faster?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:26:03+00:00Added an answer on June 13, 2026 at 11:26 am

    While not a direct answer to your question, there are two things you might try:

    First, have you tried the Falcon patches for 1.9.3? The patches include some pretty significant load time improvements.

    If you’re using RVM, you can do a quick-and-dirty install with

    rvm install 1.9.3 --patch falcon -n falcon
    

    Second, make sure you’re setting GC tuning environment variables. Ruby, by default, allocates GC parameters that are appropriate for small scripts, but not for full Rails apps. Here are my settings, though you’d want to derive your own based on your application’s needs:

    % env | grep RUBY_
    RUBY_HEAP_MIN_SLOTS=800000
    RUBY_HEAP_FREE_MIN=100000
    RUBY_HEAP_SLOTS_INCREMENT=300000
    RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
    RUBY_GC_MALLOC_LIMIT=79000000
    

    And my results using ruby 1.9.3-p286:

                        Stock     Stock+GC  Falcon   Falcon+GC
                        27.13     8.43      8.63     6.69
    Stock       27.13   100.00%   31.07%    31.81%   24.66%
    Stock+GC    8.43    321.83%   100.00%   102.37%  79.36%
    Falcon      8.63    314.37%   97.68%    100.00%  77.52%
    Falcon+GC   6.69    405.53%   126.01%   129.00%  100.00%
    

    Setting the GC tuning parameters has the biggest improvement, but we can get yet another ~26% improvement performance by using the falcon patches. The combination of the falcon patches plus the GC parameters results in over a 75% reduction in boot time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(This is a follow-up from this previous question ). I was able to successfully
A bit of a follow on from this question: Best way to use Google's
This is a follow up question from a previous SO question . Now I
This is a follow up to a previous question which seems to have confused
For Eg : Follow @SoccerBible, RT this & if Ronaldo scores https://bit.ly/133/com tonight we'll
This is a follow-on question to Is publishing/subscribing to events after UI rendering a
This is a follow-up question to an answer I gave a few days back
This is a follow-up question to another SO question of mine . I have
This is a follow on from here: Storing database settings outside app.config So I
I have been trying to follow this example (download the source code from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.