Created
April 16, 2013 10:01
-
-
Save jugyo/5394794 to your computer and use it in GitHub Desktop.
How to use Rack::RubyProf on ruby 1.9 and rails 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… | |
gem 'ruby-prof' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment