Skip to content

Instantly share code, notes, and snippets.

@josevalim
Created November 14, 2011 10:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josevalim/1363651 to your computer and use it in GitHub Desktop.
Save josevalim/1363651 to your computer and use it in GitHub Desktop.
Ruby-Prof
source :rubygems
gem "ruby-prof"
require "rubygems"
require "bundler/setup"
require "ruby-prof"
RubyProf.start
# Code to profile
result = RubyProf.stop
printer = RubyProf::CallStackPrinter.new(result)
printer.print(Rails.root.join("tmp/profiler_#{Time.now.to_f}.html", "w"))
puts :DONE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment