ruby-prof

Is it possible to ignore irrelevant methods when profiling ruby applications?

我只是一个虾纸丫 提交于 2019-12-31 02:42:08
问题 While using ruby-prof, printed out in graph-html mode, the report for one method says (with some snipping) %Total %Self Total Self Wait Child Calls Name Line 52.85% 0.00% 51.22 0.00 0.00 51.22 1 ClassName#method_name 42 51.22 0.00 0.00 51.22 1/3 Hash#each 4200 Obviously, it's not Hash#each that's taking a long time, but the yield block within Hash#each. Looking at the report for Hash#each is confusing because it reports on all of the code called by anything that uses Hash#each. Is it possible

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

柔情痞子 提交于 2019-12-17 21:53:18
问题 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 3.2.16 event_bus 1.0.0 (https://github.com/kevinrutherford/event_bus) activerecord-fast-import (https://github.com/jsuchal/activerecord-fast-import) Rake task Imports a CSV file directly into a MySql database using DATA LOAD INFILE and Active Record objects.

Profiling Ruby Code

半腔热情 提交于 2019-11-30 05:52:16
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 time is being spent in my code. I realize ruby-prof provides this, but the output is frankly very confusing and doesn't make it easy to find out which actual blocks of your own code are the source of the issue (it tells you about which method calls took the most time though). So I'm not really getting as much out of it as I'd like, and haven't really

Profiling Ruby Code

徘徊边缘 提交于 2019-11-29 01:39:08
问题 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 time is being spent in my code. I realize ruby-prof provides this, but the output is frankly very confusing and doesn't make it easy to find out which actual blocks of your own code are the source of the issue (it tells you about which method calls

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

℡╲_俬逩灬. 提交于 2019-11-28 17:03:06
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 3.2.16 event_bus 1.0.0 ( https://github.com/kevinrutherford/event_bus ) activerecord-fast-import ( https://github.com/jsuchal/activerecord-fast-import ) Rake task Imports a CSV file directly into a MySql database using DATA LOAD INFILE and Active Record objects. What I've Tried I've tried the modes RubyProf::ALLOCATIONS RubyProf::MEMORY All it says in the