Skip to content

Instantly share code, notes, and snippets.

@pftg
Created October 1, 2016 22:19
Show Gist options
  • Save pftg/369b7389b302e660ad5b43fc72ab2621 to your computer and use it in GitHub Desktop.
Save pftg/369b7389b302e660ad5b43fc72ab2621 to your computer and use it in GitHub Desktop.
Rails Initializers Boot Perfromance
# config/application.rb
module RailsApp
class Application < Rails::Application
ActiveSupport::Notifications.subscribe('load_config_initializer.railties') do |*args|
event = ActiveSupport::Notifications::Event.new(*args)
puts "Loaded initializer #{event.payload[:initializer]} (#{event.duration}ms)"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment