Skip to content

Commit

Permalink
make it load with all relative[ly absolute] paths for its requires so…
Browse files Browse the repository at this point in the history
… that it can be used to benchmark rubygems startup overhead, too
  • Loading branch information
rdp committed Mar 30, 2011
1 parent 1e21ab1 commit 5f4ca0f
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 11 deletions.
14 changes: 14 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ The third way of using ruby-prof is by requiring unprof.rb:
This will start profiling immediately at that point and will output the results
using a flat profile report after the process ends.


== Benchmarking full load time ==

If you want to get a more accurate measurement of what takes a gem's bin/xxx
command its time to load, you may want to also measure rubygems' startup penalty.
You can do this by calling into bin/ruby-prof directly, ex:


$ ruby C:/installs/Ruby187/lib/ruby/gems/1.8/gems/ruby-prof-0.10.0/bin/ruby-prof D:\Ruby192\bin\ruby-prof

or

$ ruby C:/installs/Ruby187/lib/ruby/gems/1.8/gems/ruby-prof-0.10.0/bin/ruby-prof some_file_that_does_a_require_rubygems_at_the_beginning

== Method Elimination

Starting with release 0.9.0, ruby-prof supports eliminating methods from profiling
Expand Down
6 changes: 3 additions & 3 deletions bin/ruby-prof
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ opts = OptionParser.new do |opts|
end

opts.on("-v","Show version, set $VERBOSE to true, profile script") do
puts "ruby_prof " + RubyProf::VERSION
puts "ruby " + RUBY_DESCRIPTION
$VERBOSE= true
puts "ruby_prof version: " + RubyProf::VERSION
puts "ruby version: " + RUBY_DESCRIPTION
$VERBOSE = true
end

opts.on("-d", "Set $DEBUG to true") do
Expand Down
1 change: 0 additions & 1 deletion lib/ruby-prof/call_stack_printer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'ruby-prof/abstract_printer'
require 'erb'
require 'fileutils'

Expand Down
1 change: 0 additions & 1 deletion lib/ruby-prof/call_tree_printer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'ruby-prof/abstract_printer'

module RubyProf
# Generate profiling information in calltree format
Expand Down
1 change: 0 additions & 1 deletion lib/ruby-prof/dot_printer.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'set'
require 'ruby-prof/abstract_printer'

module RubyProf
# Generates a graphviz graph in dot format.
Expand Down
1 change: 0 additions & 1 deletion lib/ruby-prof/flat_printer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'ruby-prof/abstract_printer'

module RubyProf
# Generates flat[link:files/examples/flat_txt.html] profile reports as text.
Expand Down
3 changes: 1 addition & 2 deletions lib/ruby-prof/flat_printer_with_line_numbers.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'ruby-prof/abstract_printer'
require 'pathname'

module RubyProf
# Generates flat[link:files/examples/flat_txt.html] profile reports as text.
# To use the flat printer with line numbers:
Expand Down
1 change: 0 additions & 1 deletion lib/ruby-prof/graph_html_printer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'ruby-prof/abstract_printer'
require 'erb'

module RubyProf
Expand Down
1 change: 0 additions & 1 deletion lib/ruby-prof/graph_printer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'ruby-prof/abstract_printer'

module RubyProf
# Generates graph[link:files/examples/graph_txt.html] profile reports as text.
Expand Down

0 comments on commit 5f4ca0f

Please sign in to comment.