Ruby Prof 1.0

ruby-prof’s is one of the oldest gems around, dating all the way back to 2005. I did a fair of development back in 2008 to 2013 but its been six years since I’ve meaningfully contributed. Since then, Stefan Kaes (https://github.com/skaes) has done a great job shepherding the project along. Unfortunately, Stefan had to step aside a couple of years ago.

Unsurprisingly, ruby-prof had grown a bit long in the tooth.  As ruby has continued to evolve, ruby-prof hasn’t been able to take advantage of its new features. And it still carried some baggage from its long history.  So it seemed like a good time to jump back into ruby-prof, clean it up, and finally get a 1.0 version out the door. After a couple weeks of work, version 1.0 has been released!

Version 1.0 is a significant update that greatly improves the internals of ruby-prof and includes a number of improvements:

  • Profiling is significantly faster (5x in some cases)
  • Recursive profiles are finally handled correctly.  Yeah!!!
  • Redesigned reports.
  • The ability to measure allocations and memory usage using a standard (unpatched) version of ruby
  • The ability to save and reload profiling results for later analysis
  • The ability track object allocations
  • A new documentation site at https://ruby-prof.github.io/
At the same time, it was also time to remove old code and deprecated methods. These changes include:

 

  • Drop support for old versions of ruby. Currently 2.4 and up are required.
  • Remove support for method elimination (instead use method exclusion).
  • Remove the CPU_TIME measurement mode since it duplicates the PROCESS_TIME mode and required inline assembly code
  • Remove the GC_TIME and GC_RUNS measurement modes since they required patched ruby versions. In modern ruby it is possible to reimplement this functionality, but it does not seem of that much value (shout out if you want it back).
  • Merge the RubyProf::FlatPrinterWithLineNumbers printer into RubyProf::FlatPrinter. 
  • Removed support for RUBY_PROF_EDITOR_URI environment variable that specified the link scheme. This features was more confusing then helpful. 

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *

Top