3 ms·
I think the main reason for this is that there's no 'convention' to profiling a gem. No one's built something that's super simple, off the shelf and easy to us
by ScotterC 13y ago
I think the main reason for this is that there's no 'convention' to profiling a gem. No one's built something that's super simple, off the shelf and easy to use. If someone did, and it got enough traction, it could be as much a part of the gem building process as bundler or jeweler is right now.
- cheald 13y agoruby-prof has been around forever. Combine it with kcachegrind and you have a very powerful toolset. I wrote about instrumenting Rails apps here: https://www.coffeepowered.net/2013/08/02/ruby-prof-for-rails/ https://www.coffeepowered.net/2013/08/02/ruby-prof-for-rails... The same concept applies to gems. You just construct a scenario that stresses your gem internals, run it with ruby-prof, pop open the resulting dump in kcachegrind or similar, and explore to find the hotspots. I did something like this for MongoMapper, and documented the process here: https://www.coffeepowered.net/2013/07/29/mongomapper-performance-improvement/ https://www.coffeepowered.net/2013/07/29/mongomapper-perform...