Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Ruby Programming/Standard Library/Profiler

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Description Ruby has a "pure ruby" profiler that comes with the standard lib. To use it ruby -rprofile file_name.rb or require 'profile' somewhere in your script (it will profile after that point). See profile.rb file $ gem which profile.rb to see an example of how it starts itself. This will work with any version of Ruby, but doesn't accommodate for multiple threads, and it uses uses set_trace_func, which is slow. If you're on MRI, checkout the ruby-prof gem as a C'ified profiler that works much faster and accommodates for threads. Jruby also has a jruby-prof gem.