A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.wikibooks.org/wiki/Ruby_Programming/Standard_Library/Profiler below:

Ruby Programming/Standard Library/Profiler - Wikibooks, open books for an open world

From Wikibooks, open books for an open world

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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4