Questions tagged [ruby-prof]

34 questions
59
votes
1 answer

Understanding ruby-prof output

I ran ruby-profiler on one of my programs. I'm trying to figure out what each fields mean. I'm guessing everything is CPU time (and not wall clock time), which is fantastic. I want to understand what the "---" stands for. Is there some sort of stack…
Prasanna
  • 735
  • 7
  • 10
35
votes
4 answers

Profiling Ruby Code

Besides ruby-prof and and the core Benchmark class, what do you use to profile your Ruby code? In particular, how do you find the bottlenecks in your code? It almost feels like I need to work on my own little tool just to figure out where all the…
ehsanul
  • 7,737
  • 7
  • 33
  • 43
32
votes
4 answers

How do I track down a memory leak in my Ruby code?

Question I'm debugging a memory leak in a rake task. I want to see a call stack of: Living objects What object or line originally allocated those objects Is this possible with ruby-prof? If not, what tool should I use? Setup Gems rails…
John Gallagher
  • 6,208
  • 6
  • 40
  • 75
19
votes
3 answers

How to profile Rake task?

I need to profile the rake task. Cause I'm noob I know only how to profile .rb code like this: ruby -Ilib -S ruby-prof -p graph_html profile.rb > profile.html But how do I profile a specific Rake task?
Daniel
  • 534
  • 4
  • 16
10
votes
2 answers

Newrelic developermode not working with ruby-prof

I'm using the newrelic_rpm developer mode locally in a rails 3.2 app. This is working fine. When I install ruby-prof and click "start profiling" in the newrelic local dashboard and go back to my app, every page in my app gives "undefined method…
Tim Diggins
  • 4,364
  • 3
  • 30
  • 49
8
votes
3 answers

How can I profile Ruby code in 1.9.2?

What can I use to profile code in 1.9.2? All of the versions of ruby-prof I've found segfault against 1.9.2. For instance, when I add gem "ruby-prof" to my Rails project's Gemfile and run bundle bundle exec ruby-prof config/environment.rb I get a…
Peeja
  • 13,683
  • 11
  • 58
  • 77
8
votes
5 answers

Errors with ruby-prof in a Rails Performance Test

I'm creating a Rails Performance test, as described in the Rails Guide, and I'm having problems with ruby-prof. I'm using Ruby 1.9.2-p0 (though experienced the same issue on p320) and Rails 3.1.0. I have a pretty simple test for a controller that is…
Craig Walker
  • 49,871
  • 54
  • 152
  • 212
7
votes
2 answers

How do I get ruby-prof to ignore Ruby core / standard library / gem methods?

I'm new to Ruby profiling, and it seems like ruby-prof is a popular choice. I just installed the gem and invoked my program: ruby-prof ./my-prog.rb However, the output is incredibly verbose, because profiling data for all the Ruby core and…
Adam Spiers
  • 17,397
  • 5
  • 46
  • 65
5
votes
5 answers

Mutex sleep is taking a lot of CPU

I profiled my event-machine based application with ruby-prof and found the following interesting: 5.28 0.00 5.28 0.00 4/4 Mutex#synchronize 90.72% 0.00% 5.28 0.00 5.28 0.00 4 …
Prasanna
  • 735
  • 7
  • 10
5
votes
1 answer

Profile Jekyll build time

I use Jekyll to build my site, and it is starting to take a rather long time (a few minutes) to compile the site (of a bit more than 600 posts). I suspect that some plugins might be responsible, but it seems there must be a better way to profile the…
cboettig
  • 12,377
  • 13
  • 70
  • 113
4
votes
1 answer

Ruby segmentation fault when running a profile test

I get the segmentation fault error below when I run rake test:profile. I'm using ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]. But it also happens with the p320 version of Ruby 1.9.2 and similar error happens with Ruby…
Manuel M
  • 469
  • 4
  • 13
4
votes
3 answers

Ruby profiler stack level too deep error

It seems like I always get this error on one of my scripts: /Users/amosng/.rvm/gems/ruby-1.9.3-p194/gems/ruby-prof-0.11.2/lib/ruby-prof/profile.rb:25: stack level too deep (SystemStackError) Has anyone encountered this error before? What could be…
wrongusername
  • 18,564
  • 40
  • 130
  • 214
3
votes
2 answers

How do you output call tree profiling for KCacheGrind with ruby-prof for a Rails app?

According to the documentation, you can profile Rails apps http://ruby-prof.rubyforge.org/ I added this to my config.ru if Rails.env.development? use Rack::RubyProf, :path => 'tmp/profile' end However it only outputs the following…
Chloe
  • 25,162
  • 40
  • 190
  • 357
2
votes
2 answers

Which is the best graphical ruby profiler?

The best match that I have found until now is to use ruby-prof from command line and try to guess the graph reading from there. require 'ruby-prof' # Profile the code RubyProf.start ... [code to profile] ... result = RubyProf.stop # Print a flat…
user989959
  • 21
  • 3
2
votes
0 answers

When using ruby-prof, what is the source of `[global]#[no method]` in the profiler output?

Short Version: What is the source of [global]#[no method] in the Ruby profiler output below, and is there any way to eliminate it or reduce its time? It's taking up over 50% of the total execution time for my method and it's the only part of the…
Richie Thomas
  • 3,073
  • 4
  • 32
  • 55
1
2 3