Skip to content

Instantly share code, notes, and snippets.

@robdimarco
Created June 20, 2014 14:36
Show Gist options
  • Save robdimarco/e610b2b5c31c68bb13fe to your computer and use it in GitHub Desktop.
Save robdimarco/e610b2b5c31c68bb13fe to your computer and use it in GitHub Desktop.
Profile Rails Startup
#! /usr/bin/env ruby -rruby-prof
# Profile the code
RubyProf.start
load "#{ENV['PWD']}/config/environment.rb"
result = RubyProf.stop
# Print a flat profile to text
printer = RubyProf::FlatPrinter.new(result)
printer.print(STDOUT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment