Skip to content

Instantly share code, notes, and snippets.

@lukeasrodgers
Created October 15, 2015 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukeasrodgers/1f63c3beb878007540af to your computer and use it in GitHub Desktop.
Save lukeasrodgers/1f63c3beb878007540af to your computer and use it in GitHub Desktop.
quick ruby profiling
# Gemfile
gem 'ruby-prof'
# code to profile
require 'ruby-prof'
RubyProf.start
# run code
result = RubyProf.stop
printer = RubyProf::CallStackPrinter.new(result)
f = File.open('/somehwere/public/prof.html', 'w+')
printer.print(f)
f.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment