Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created April 16, 2013 10:01
Show Gist options
  • Save jugyo/5394794 to your computer and use it in GitHub Desktop.
Save jugyo/5394794 to your computer and use it in GitHub Desktop.
How to use Rack::RubyProf on ruby 1.9 and rails 3
# Workaround for stack level too deep error. see also : http://stackoverflow.com/questions/11692559/ruby-profiler-stack-level-too-deep-error
RubyVM::InstructionSequence.compile_option = {
:tailcall_optimization => true,
:trace_instruction => false
}
use Rack::RubyProf, :path => '/tmp/profile'
# specify printers (by default all printers are used)
# use Rack::RubyProf, :path => '/tmp/profile', :printers => {::RubyProf::FlatPrinter => 'flat.txt'}
require ::File.expand_path('../config/environment', __FILE__)
run XXX::Application
gem 'ruby-prof'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment