Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

add verbose output to rails startup if RAILS_VERBOSE_STARTUP env is true

#2792

Once you have lots of gems and plugins and routes start can take a long time. It helps a lot to see verbose output of what is taking so long. This patch file make rails show nice output like:

                   starting 0.0000
         check_ruby_version 0.0016
     install_gem_spec_stubs 0.0016
              set_load_path 0.0006
         add_gem_load_paths 0.0330
                         ============== REQUIRE FRAMEWORKS =================
                                              active_record 0.0107
                                          action_controller 0.0023
                                                action_view 0.0023
                                              action_mailer 0.2798
                                            active_resource 0.3606
         set_autoload_paths 0.0001
      add_plugin_load_paths 0.1356
           load_environment 0.0736
         preload_frameworks 0.0000
        initialize_encoding 0.0000
        initialize_database 0.3531
           initialize_cache 0.0059
initialize_framework_caches 0.1401
          initialize_logger 0.0019

initialize_framework_logging 0.0001 initialize_dependency_mechanism 0.0000

      initialize_whiny_nils 0.0035
       initialize_time_zone 0.0000
            initialize_i18n 0.0000

initialize_framework_settings 0.0002

 initialize_framework_views 0.0017
           initialize_metal 0.0148
     add_support_load_paths 0.0000

etc.

if the env var RAILS_VERBOSE_STARTUP is set.

Reported by Andrew Arrow · June 11th, 2009 @ 06:10 PM

State: new
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. Nick Quaranto
    Nick Quaranto

    I love this idea, but I'm not necessarily sure if this should be in the core. I think this extended out to more parts of the framework could be a great way to benchmark what's slow about an app and even point out parts that need refactoring. If you could wrap this up in a decent plugin/gem and it could go far.

    June 11th, 2009 @ 06:21 PM

  2. Andrew Arrow
    Andrew Arrow

    Thanks Nick! Trouble is I need to hack into rails before any plugin or gem is loaded. By the time it gets to loading my gem, it's too late. But the patch as is needs some work. I just threw it in my local copy of rails and have been using it. I figured some rails core guru could take it from here and implement it cleaner if they see the value.

    June 11th, 2009 @ 07:32 PM

  3. Daniel Schierbeck
  4. Daniel Schierbeck
    Daniel Schierbeck

    Hi Andrew

    I like the concept, but I think the patch definitely needs to be cleaned up. I've fixed some of it; take a look if you want :-)

    June 12th, 2009 @ 12:45 AM

  5. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  6. bingbing