From: SASADA Koichi Date: 2011-09-09T00:55:40+09:00 Subject: [ruby-core:39367] Re: [Feature: Ruby 1.9] profile interface Hi, (2011/09/06 22:58), Charlie Savage wrote: >> I made a simple profiling interface. >> Of course, method names and other programming interfaces should be >> considered. >> >> experimental implementation: >> http://www.atdot.net/sp/view/ht3mql/readonly?lang=diff >> >> For example, you can get a following information with short code: >> >> {} # create a hash object >> require 'pp' >> pp RubyVM::profile_get > > To be most useful, you would want to know which methods resulted in > which actions. If I am profiling a Rails application, which method > created the most objects and of what type. Would this implementation > allow that? Here is a good example: > > http://tenderlovemaking.com/2011/06/29/i-want-dtrace-probes-in-ruby/ > > Also, would it be better to hook up Dtrace instead (although that won't > work on Windows for example). I agree with you that your proposal is useful. However, I think such measurements should on the upper layer of it. I'll expand this primitive profiler interface to support such a measurements. (enables to register hook function, in easy words) -- // SASADA Koichi at atdot dot net