ruby-prof 0.13.1 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +14 -0
  3. data/README.rdoc +1 -1
  4. data/Rakefile +2 -3
  5. data/bin/ruby-prof +4 -4
  6. data/bin/ruby-prof-check-trace +45 -0
  7. data/doc/LICENSE.html +49 -88
  8. data/doc/README_rdoc.html +92 -106
  9. data/doc/Rack.html +47 -116
  10. data/doc/Rack/RubyProf.html +119 -174
  11. data/doc/RubyProf.html +184 -216
  12. data/doc/RubyProf/AbstractPrinter.html +131 -162
  13. data/doc/RubyProf/AggregateCallInfo.html +136 -166
  14. data/doc/RubyProf/CallInfo.html +113 -154
  15. data/doc/RubyProf/CallInfoPrinter.html +56 -123
  16. data/doc/RubyProf/CallInfoVisitor.html +87 -216
  17. data/doc/RubyProf/CallStackPrinter.html +222 -215
  18. data/doc/RubyProf/CallTreePrinter.html +91 -142
  19. data/doc/RubyProf/Cmd.html +115 -157
  20. data/doc/RubyProf/DotPrinter.html +88 -140
  21. data/doc/RubyProf/FlatPrinter.html +66 -129
  22. data/doc/RubyProf/FlatPrinterWithLineNumbers.html +69 -132
  23. data/doc/RubyProf/GraphHtmlPrinter.html +115 -166
  24. data/doc/RubyProf/GraphPrinter.html +58 -125
  25. data/doc/RubyProf/MethodInfo.html +147 -172
  26. data/doc/RubyProf/MultiPrinter.html +104 -150
  27. data/doc/RubyProf/Profile.html +125 -179
  28. data/doc/RubyProf/ProfileTask.html +117 -157
  29. data/doc/RubyProf/Test.html +115 -154
  30. data/doc/RubyProf/Thread.html +87 -147
  31. data/doc/created.rid +13 -14
  32. data/doc/examples/flat_txt.html +51 -90
  33. data/doc/examples/graph_html.html +852 -0
  34. data/doc/examples/graph_txt.html +64 -92
  35. data/doc/fonts.css +167 -0
  36. data/doc/fonts/Lato-Light.ttf +0 -0
  37. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  38. data/doc/fonts/Lato-Regular.ttf +0 -0
  39. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  40. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  41. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  42. data/doc/images/add.png +0 -0
  43. data/doc/images/arrow_up.png +0 -0
  44. data/doc/images/delete.png +0 -0
  45. data/doc/images/tag_blue.png +0 -0
  46. data/doc/index.html +75 -65
  47. data/doc/js/darkfish.js +0 -15
  48. data/doc/js/search.js +20 -5
  49. data/doc/js/search_index.js +1 -1
  50. data/doc/rdoc.css +255 -218
  51. data/doc/table_of_contents.html +751 -353
  52. data/ext/ruby_prof/extconf.rb +20 -22
  53. data/ext/ruby_prof/rp_measure_allocations.c +9 -5
  54. data/ext/ruby_prof/rp_measure_gc_runs.c +8 -0
  55. data/ext/ruby_prof/rp_measure_gc_time.c +5 -2
  56. data/ext/ruby_prof/rp_measure_wall_time.c +1 -0
  57. data/ext/ruby_prof/rp_method.c +0 -9
  58. data/ext/ruby_prof/rp_method.h +1 -6
  59. data/ext/ruby_prof/ruby_prof.c +32 -112
  60. data/ext/ruby_prof/ruby_prof.h +9 -10
  61. data/lib/ruby-prof.rb +2 -1
  62. data/lib/ruby-prof/aggregate_call_info.rb +4 -6
  63. data/lib/ruby-prof/call_info_visitor.rb +42 -44
  64. data/lib/ruby-prof/printers/graph_html_printer.rb +0 -8
  65. data/lib/ruby-prof/profile.rb +4 -4
  66. data/lib/ruby-prof/rack.rb +47 -47
  67. data/lib/ruby-prof/task.rb +0 -0
  68. data/lib/ruby-prof/thread.rb +22 -22
  69. data/lib/ruby-prof/version.rb +3 -0
  70. data/ruby-prof.gemspec +7 -11
  71. data/test/call_info_test.rb +78 -78
  72. data/test/call_info_visitor_test.rb +31 -31
  73. data/test/fiber_test.rb +2 -2
  74. data/test/measure_gc_runs_test.rb +1 -1
  75. data/test/measure_process_time_test.rb +7 -6
  76. data/test/printers_test.rb +4 -8
  77. data/test/recursive_test.rb +5 -9
  78. data/test/test_helper.rb +1 -1
  79. data/test/unique_call_path_test.rb +7 -29
  80. data/test/yarv_test.rb +55 -0
  81. metadata +63 -55
  82. data/ext/ruby_prof/version.h +0 -7
  83. data/lib/ruby-prof/test.rb +0 -150
  84. data/test/exec_test.rb +0 -14
  85. data/test/test_suite.rb +0 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4981adb0602037a3dbf06674dc2df341ff80fce9
4
- data.tar.gz: b6ba1051e11bd2e193bb99cd786bc16681ea159a
3
+ metadata.gz: 58c4eddbefb502b7fc6aed63c60bd88dff0aab16
4
+ data.tar.gz: 47f65276f52c83ab7b9cd52ef5d8ac9371eac8fe
5
5
  SHA512:
6
- metadata.gz: 5c8db375d6009b0da09e60a890bc605f5d289ca8e868cebd01910b3b8c788bf140dda2473a149578bf540ab863b355905c9b87386dbc2b05f707609a031efece
7
- data.tar.gz: 22c4d62dda4759db6d4c29581b3ab5634da90cae709715229ce30a0c57ef00a73ec7b44f9f5006a0999c7679f8595a597e441b76ad4750c66a986621c4dc6c0f
6
+ metadata.gz: 5a172ee75e538707c82fc6981ebdd1ec7c5d4c65a9e815b5d1dc63da24f42110b3526de030d44dc531771abb006feee0de34766ee3f6b7d80c577dd2ab4cb543
7
+ data.tar.gz: 56b30d0dd96628fac0ccc19308a0a44db2d5045e21edf09e361fe2fb0a0a891c134c0e33800ce2f55869d97ca9172527af1bfbad2a989f804d8117e26ef102aa
data/CHANGES CHANGED
@@ -1,3 +1,17 @@
1
+ 0.14.0 (2012-01-02)
2
+ ======================
3
+ * support ruby 2.1.0
4
+ * dropped support for 1.8.x, 1.9.1 and 1.9.2
5
+
6
+ 0.13.1 (2013-12-14)
7
+ ======================
8
+ * speed up for displaying large call stacks (Benjamin Quoming)
9
+
10
+ 0.13 (2013-03-10)
11
+ ======================
12
+ * support fibers on 1.9.x+
13
+ * improved display for very wide call stacks (Sammy Larbi)
14
+
1
15
  0.12.2 (2013-02-13)
2
16
  ======================
3
17
  * Fixed segfault when using falcon or railsexpress patches for 1.9.3
data/README.rdoc CHANGED
@@ -16,7 +16,7 @@ ruby-prof is a fast code profiler for Ruby. Its features include:
16
16
 
17
17
  == Requirements
18
18
 
19
- ruby-prof requires Ruby 1.8.7 or 1.9.2 and higher.
19
+ ruby-prof requires Ruby 1.9.3 or higher.
20
20
 
21
21
  If you are running Linux or Unix you'll need a C compiler so the extension
22
22
  can be compiled when it is installed.
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ rescue LoadError
15
15
  end
16
16
 
17
17
  # To release a version of ruby-prof:
18
- # * Update version.h
18
+ # * Update lib/ruby-prof/version.rb
19
19
  # * Update CHANGES
20
20
  # * git commit to commit files
21
21
  # * rake clobber to remove extra files
@@ -85,7 +85,6 @@ RDoc::Task.new("rdoc") do |rdoc|
85
85
  'examples/graph.html',
86
86
  'lib/**/*.rb',
87
87
  'ext/ruby_prof/ruby_prof.c',
88
- 'ext/ruby_prof/version.h',
89
88
  'ext/ruby_prof/measure_*.h',
90
89
  'README.rdoc',
91
90
  'LICENSE')
@@ -104,7 +103,7 @@ end
104
103
  desc 'Run the ruby-prof test suite'
105
104
  Rake::TestTask.new do |t|
106
105
  t.libs += %w(lib ext test)
107
- t.test_files = Dir['test/test_suite.rb']
106
+ t.test_files = Dir['test/**_test.rb']
108
107
  t.verbose = true
109
108
  t.warning = true
110
109
  end
data/bin/ruby-prof CHANGED
@@ -149,7 +149,7 @@ module RubyProf
149
149
  options.replace_prog_name = true
150
150
  end
151
151
 
152
- if defined?(VM)
152
+ if defined?(RubyVM)
153
153
  opts.on("--specialized-instruction", "Turn on specified instruction.") do
154
154
  options.specialized_instruction = true
155
155
  end
@@ -273,8 +273,8 @@ module RubyProf
273
273
  end
274
274
 
275
275
  # Set VM compile option
276
- if defined?(VM)
277
- VM::InstructionSequence.compile_option = {
276
+ if defined?(RubyVM)
277
+ RubyVM::InstructionSequence.compile_option = {
278
278
  :trace_instruction => true,
279
279
  :specialized_instruction => options.specialized_instruction
280
280
  }
@@ -326,4 +326,4 @@ at_exit {
326
326
  }
327
327
 
328
328
  # Now profile some code
329
- cmd.run
329
+ cmd.run
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ stacks = Hash.new{|h,k| h[k] = Hash.new{|h,k| h[k] = []}}
4
+ i = 0
5
+ File.open(ARGV[0]).each_line do |l|
6
+ i += 1
7
+ unless l =~ /^(\d+):(\d+): *\d+ms *([^ ]+) *(.*): *(\d+) *(.+)$/
8
+ next if l =~/^ *$/
9
+ puts "line doesn't match: #{l}"
10
+ next
11
+ end
12
+ details = $1.to_i, $2.to_i, $3, $4, $5.to_i, $6
13
+ thread, fiber, event, file, line, method = *details
14
+ # puts method
15
+ stack = stacks[thread][fiber]
16
+ case event
17
+ when 'call', 'c-call'
18
+ stack << method
19
+ when 'return', 'c-return'
20
+ last_method = stack.pop
21
+ if last_method != method
22
+ puts "LINE #{i}: return event without call: #{method}"
23
+ puts "STACK: #{stack.inspect}"
24
+ if stack.find(method)
25
+ puts "fixing stack"
26
+ while (popped = stack.pop) && (popped != method)
27
+ puts "popped #{popped}"
28
+ end
29
+ else
30
+ raise "stack unfixable"
31
+ end
32
+ # stack << last_method
33
+ end
34
+ when 'line'
35
+ last_method = stack[-1]
36
+ if last_method != method
37
+ unless stack.find(method)
38
+ raise "LINE #{i}: line event without call: #{method}"
39
+ end
40
+ end
41
+ else
42
+ puts "unkown event"
43
+ end
44
+ end
45
+ puts stacks.inspect
data/doc/LICENSE.html CHANGED
@@ -2,121 +2,83 @@
2
2
 
3
3
  <html>
4
4
  <head>
5
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
5
+ <meta charset="UTF-8">
6
6
 
7
7
  <title>LICENSE - ruby-prof</title>
8
8
 
9
- <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
9
+ <link href="./fonts.css" rel="stylesheet">
10
+ <link href="./rdoc.css" rel="stylesheet">
10
11
 
11
12
  <script type="text/javascript">
12
13
  var rdoc_rel_prefix = "./";
13
14
  </script>
14
15
 
15
- <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
- <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
- <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
- <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
- <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
- <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
16
+ <script src="./js/jquery.js"></script>
17
+ <script src="./js/navigation.js"></script>
18
+ <script src="./js/search_index.js"></script>
19
+ <script src="./js/search.js"></script>
20
+ <script src="./js/searcher.js"></script>
21
+ <script src="./js/darkfish.js"></script>
21
22
 
22
23
 
23
- <body class="file">
24
- <nav id="metadata">
25
- <nav id="home-section" class="section">
26
- <h3 class="section-header">
27
- <a href="./index.html">Home</a>
24
+ <body id="top" role="document" class="file">
25
+ <nav role="navigation">
26
+ <div id="project-navigation">
27
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
+ <h2>
29
+ <a href="./index.html" rel="home">Home</a>
30
+ </h2>
31
+
32
+ <div id="table-of-contents-navigation">
33
+ <a href="./table_of_contents.html#pages">Pages</a>
28
34
  <a href="./table_of_contents.html#classes">Classes</a>
29
35
  <a href="./table_of_contents.html#methods">Methods</a>
30
- </h3>
31
- </nav>
32
-
36
+ </div>
37
+ </div>
33
38
 
34
- <nav id="search-section" class="section project-section" class="initially-hidden">
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
35
40
  <form action="#" method="get" accept-charset="utf-8">
36
- <h3 class="section-header">
37
- <input type="text" name="search" placeholder="Search" id="search-field"
41
+ <div id="search-field-wrapper">
42
+ <input id="search-field" role="combobox" aria-label="Search"
43
+ aria-autocomplete="list" aria-controls="search-results"
44
+ type="text" name="search" placeholder="Search" spellcheck="false"
38
45
  title="Type to search, Up and Down to navigate, Enter to load">
39
- </h3>
40
- </form>
41
-
42
- <ul id="search-results" class="initially-hidden"></ul>
43
- </nav>
46
+ </div>
44
47
 
48
+ <ul id="search-results" aria-label="Search Results"
49
+ aria-busy="false" aria-expanded="false"
50
+ aria-atomic="false" class="initially-hidden"></ul>
51
+ </form>
52
+ </div>
45
53
 
46
- <div id="project-metadata">
47
- <nav id="fileindex-section" class="section project-section">
48
- <h3 class="section-header">Pages</h3>
54
+ </div>
49
55
 
50
- <ul>
51
-
52
- <li class="file"><a href="./LICENSE.html">LICENSE</a>
53
-
54
- <li class="file"><a href="./README_rdoc.html">README</a>
55
-
56
- <li class="file"><a href="./examples/flat_txt.html">flat</a>
57
-
58
- <li class="file"><a href="./examples/graph_txt.html">graph</a>
59
56
 
60
- </ul>
61
- </nav>
62
57
 
63
- <nav id="classindex-section" class="section project-section">
64
- <h3 class="section-header">Class and Module Index</h3>
58
+ <div id="project-metadata">
59
+ <div id="fileindex-section" class="nav-section">
60
+ <h3>Pages</h3>
65
61
 
66
62
  <ul class="link-list">
67
63
 
68
- <li><a href="./RubyProf.html">RubyProf</a>
69
-
70
- <li><a href="./RubyProf/AbstractPrinter.html">RubyProf::AbstractPrinter</a>
71
-
72
- <li><a href="./RubyProf/AggregateCallInfo.html">RubyProf::AggregateCallInfo</a>
64
+ <li><a href="./LICENSE.html">LICENSE</a>
73
65
 
74
- <li><a href="./RubyProf/CallInfo.html">RubyProf::CallInfo</a>
66
+ <li><a href="./README_rdoc.html">README</a>
75
67
 
76
- <li><a href="./RubyProf/CallInfoPrinter.html">RubyProf::CallInfoPrinter</a>
68
+ <li><a href="./examples/flat_txt.html">flat</a>
77
69
 
78
- <li><a href="./RubyProf/CallInfoVisitor.html">RubyProf::CallInfoVisitor</a>
70
+ <li><a href="./examples/graph_html.html">graph.html</a>
79
71
 
80
- <li><a href="./RubyProf/CallStackPrinter.html">RubyProf::CallStackPrinter</a>
81
-
82
- <li><a href="./RubyProf/CallTreePrinter.html">RubyProf::CallTreePrinter</a>
83
-
84
- <li><a href="./RubyProf/Cmd.html">RubyProf::Cmd</a>
85
-
86
- <li><a href="./RubyProf/DotPrinter.html">RubyProf::DotPrinter</a>
87
-
88
- <li><a href="./RubyProf/FlatPrinter.html">RubyProf::FlatPrinter</a>
89
-
90
- <li><a href="./RubyProf/FlatPrinterWithLineNumbers.html">RubyProf::FlatPrinterWithLineNumbers</a>
91
-
92
- <li><a href="./RubyProf/GraphHtmlPrinter.html">RubyProf::GraphHtmlPrinter</a>
93
-
94
- <li><a href="./RubyProf/GraphPrinter.html">RubyProf::GraphPrinter</a>
95
-
96
- <li><a href="./RubyProf/MethodInfo.html">RubyProf::MethodInfo</a>
97
-
98
- <li><a href="./RubyProf/MultiPrinter.html">RubyProf::MultiPrinter</a>
99
-
100
- <li><a href="./RubyProf/Profile.html">RubyProf::Profile</a>
101
-
102
- <li><a href="./RubyProf/ProfileTask.html">RubyProf::ProfileTask</a>
103
-
104
- <li><a href="./RubyProf/Test.html">RubyProf::Test</a>
105
-
106
- <li><a href="./RubyProf/Thread.html">RubyProf::Thread</a>
107
-
108
- <li><a href="./Rack.html">Rack</a>
109
-
110
- <li><a href="./Rack/RubyProf.html">Rack::RubyProf</a>
72
+ <li><a href="./examples/graph_txt.html">graph</a>
111
73
 
112
74
  </ul>
113
- </nav>
75
+ </div>
114
76
 
115
77
  </div>
116
78
  </nav>
117
79
 
118
- <div id="documentation" class="description">
119
-
80
+ <main role="main" aria-label="Page LICENSE">
81
+
120
82
  <p>Copyright (C) 2005 - 20011 Shugo Maeda &lt;shugo@ruby-lang.org&gt; and
121
83
  Charlie Savage &lt;cfis@savagexi.com&gt; All rights reserved.</p>
122
84
 
@@ -142,14 +104,13 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
142
104
  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
143
105
  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
144
106
  DAMAGE.</p>
145
-
146
- </div>
107
+ </main>
147
108
 
148
109
 
149
110
 
150
- <footer id="validator-badges">
151
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
152
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
153
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
111
+ <footer id="validator-badges" role="contentinfo">
112
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
113
+ <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
114
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
154
115
  </footer>
155
116
 
data/doc/README_rdoc.html CHANGED
@@ -2,128 +2,115 @@
2
2
 
3
3
  <html>
4
4
  <head>
5
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
5
+ <meta charset="UTF-8">
6
6
 
7
7
  <title>README - ruby-prof</title>
8
8
 
9
- <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
9
+ <link href="./fonts.css" rel="stylesheet">
10
+ <link href="./rdoc.css" rel="stylesheet">
10
11
 
11
12
  <script type="text/javascript">
12
13
  var rdoc_rel_prefix = "./";
13
14
  </script>
14
15
 
15
- <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
- <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
- <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
- <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
- <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
- <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
16
+ <script src="./js/jquery.js"></script>
17
+ <script src="./js/navigation.js"></script>
18
+ <script src="./js/search_index.js"></script>
19
+ <script src="./js/search.js"></script>
20
+ <script src="./js/searcher.js"></script>
21
+ <script src="./js/darkfish.js"></script>
21
22
 
22
23
 
23
- <body class="file">
24
- <nav id="metadata">
25
- <nav id="home-section" class="section">
26
- <h3 class="section-header">
27
- <a href="./index.html">Home</a>
24
+ <body id="top" role="document" class="file">
25
+ <nav role="navigation">
26
+ <div id="project-navigation">
27
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
+ <h2>
29
+ <a href="./index.html" rel="home">Home</a>
30
+ </h2>
31
+
32
+ <div id="table-of-contents-navigation">
33
+ <a href="./table_of_contents.html#pages">Pages</a>
28
34
  <a href="./table_of_contents.html#classes">Classes</a>
29
35
  <a href="./table_of_contents.html#methods">Methods</a>
30
- </h3>
31
- </nav>
32
-
36
+ </div>
37
+ </div>
33
38
 
34
- <nav id="search-section" class="section project-section" class="initially-hidden">
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
35
40
  <form action="#" method="get" accept-charset="utf-8">
36
- <h3 class="section-header">
37
- <input type="text" name="search" placeholder="Search" id="search-field"
41
+ <div id="search-field-wrapper">
42
+ <input id="search-field" role="combobox" aria-label="Search"
43
+ aria-autocomplete="list" aria-controls="search-results"
44
+ type="text" name="search" placeholder="Search" spellcheck="false"
38
45
  title="Type to search, Up and Down to navigate, Enter to load">
39
- </h3>
40
- </form>
41
-
42
- <ul id="search-results" class="initially-hidden"></ul>
43
- </nav>
46
+ </div>
44
47
 
48
+ <ul id="search-results" aria-label="Search Results"
49
+ aria-busy="false" aria-expanded="false"
50
+ aria-atomic="false" class="initially-hidden"></ul>
51
+ </form>
52
+ </div>
45
53
 
46
- <div id="project-metadata">
47
- <nav id="fileindex-section" class="section project-section">
48
- <h3 class="section-header">Pages</h3>
54
+ </div>
49
55
 
50
- <ul>
51
-
52
- <li class="file"><a href="./LICENSE.html">LICENSE</a>
53
-
54
- <li class="file"><a href="./README_rdoc.html">README</a>
55
-
56
- <li class="file"><a href="./examples/flat_txt.html">flat</a>
57
-
58
- <li class="file"><a href="./examples/graph_txt.html">graph</a>
59
56
 
57
+ <div class="nav-section">
58
+ <h3>Table of Contents</h3>
59
+
60
+ <ul class="link-list" role="directory">
61
+ <li><a href="#label-ruby-prof">ruby-prof</a>
62
+ <li><a href="#label-Overview">Overview</a>
63
+ <li><a href="#label-Requirements">Requirements</a>
64
+ <li><a href="#label-Install">Install</a>
65
+ <li><a href="#label-Usage">Usage</a>
66
+ <li><a href="#label-ruby-prof+executable">ruby-prof executable</a>
67
+ <li><a href="#label-ruby-prof+API">ruby-prof API</a>
68
+ <li><a href="#label-Method+and+Thread+Elimination">Method and Thread Elimination</a>
69
+ <li><a href="#label-Benchmarking+full+load+time+including+rubygems+startup+cost+%3D%3D">Benchmarking full load time including rubygems startup cost ==</a>
70
+ <li><a href="#label-Profiling+Tests">Profiling Tests</a>
71
+ <li><a href="#label-Profiling+Rails">Profiling Rails</a>
72
+ <li><a href="#label-Reports">Reports</a>
73
+ <li><a href="#label-Printers">Printers</a>
74
+ <li><a href="#label-Measurements">Measurements</a>
75
+ <li><a href="#label-Multi-threaded+Applications">Multi-threaded Applications</a>
76
+ <li><a href="#label-Performance">Performance</a>
77
+ <li><a href="#label-License">License</a>
78
+ <li><a href="#label-Development">Development</a>
60
79
  </ul>
61
- </nav>
80
+ </div>
81
+
62
82
 
63
- <nav id="classindex-section" class="section project-section">
64
- <h3 class="section-header">Class and Module Index</h3>
83
+ <div id="project-metadata">
84
+ <div id="fileindex-section" class="nav-section">
85
+ <h3>Pages</h3>
65
86
 
66
87
  <ul class="link-list">
67
88
 
68
- <li><a href="./RubyProf.html">RubyProf</a>
69
-
70
- <li><a href="./RubyProf/AbstractPrinter.html">RubyProf::AbstractPrinter</a>
71
-
72
- <li><a href="./RubyProf/AggregateCallInfo.html">RubyProf::AggregateCallInfo</a>
89
+ <li><a href="./LICENSE.html">LICENSE</a>
73
90
 
74
- <li><a href="./RubyProf/CallInfo.html">RubyProf::CallInfo</a>
91
+ <li><a href="./README_rdoc.html">README</a>
75
92
 
76
- <li><a href="./RubyProf/CallInfoPrinter.html">RubyProf::CallInfoPrinter</a>
93
+ <li><a href="./examples/flat_txt.html">flat</a>
77
94
 
78
- <li><a href="./RubyProf/CallInfoVisitor.html">RubyProf::CallInfoVisitor</a>
95
+ <li><a href="./examples/graph_html.html">graph.html</a>
79
96
 
80
- <li><a href="./RubyProf/CallStackPrinter.html">RubyProf::CallStackPrinter</a>
81
-
82
- <li><a href="./RubyProf/CallTreePrinter.html">RubyProf::CallTreePrinter</a>
83
-
84
- <li><a href="./RubyProf/Cmd.html">RubyProf::Cmd</a>
85
-
86
- <li><a href="./RubyProf/DotPrinter.html">RubyProf::DotPrinter</a>
87
-
88
- <li><a href="./RubyProf/FlatPrinter.html">RubyProf::FlatPrinter</a>
89
-
90
- <li><a href="./RubyProf/FlatPrinterWithLineNumbers.html">RubyProf::FlatPrinterWithLineNumbers</a>
91
-
92
- <li><a href="./RubyProf/GraphHtmlPrinter.html">RubyProf::GraphHtmlPrinter</a>
93
-
94
- <li><a href="./RubyProf/GraphPrinter.html">RubyProf::GraphPrinter</a>
95
-
96
- <li><a href="./RubyProf/MethodInfo.html">RubyProf::MethodInfo</a>
97
-
98
- <li><a href="./RubyProf/MultiPrinter.html">RubyProf::MultiPrinter</a>
99
-
100
- <li><a href="./RubyProf/Profile.html">RubyProf::Profile</a>
101
-
102
- <li><a href="./RubyProf/ProfileTask.html">RubyProf::ProfileTask</a>
103
-
104
- <li><a href="./RubyProf/Test.html">RubyProf::Test</a>
105
-
106
- <li><a href="./RubyProf/Thread.html">RubyProf::Thread</a>
107
-
108
- <li><a href="./Rack.html">Rack</a>
109
-
110
- <li><a href="./Rack/RubyProf.html">Rack::RubyProf</a>
97
+ <li><a href="./examples/graph_txt.html">graph</a>
111
98
 
112
99
  </ul>
113
- </nav>
100
+ </div>
114
101
 
115
102
  </div>
116
103
  </nav>
117
104
 
118
- <div id="documentation" class="description">
119
-
120
- <h1 id="label-ruby-prof">ruby-prof</h1>
105
+ <main role="main" aria-label="Page README.rdoc">
106
+
107
+ <h1 id="label-ruby-prof">ruby-prof<span><a href="#label-ruby-prof">&para;</a> <a href="#documentation">&uarr;</a></span></h1>
121
108
 
122
109
  <p><a href="https://travis-ci.org/ruby-prof/ruby-prof"><img
123
110
  src="https://travis-ci.org/ruby-prof/ruby-prof.png?branch=master"
124
111
  alt="Build Status" /></a></p>
125
112
 
126
- <h2 id="label-Overview">Overview</h2>
113
+ <h2 id="label-Overview">Overview<span><a href="#label-Overview">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
127
114
 
128
115
  <p>ruby-prof is a fast code profiler for Ruby. Its features include:</p>
129
116
  <ul><li>
@@ -151,9 +138,9 @@ href="README_rdoc.html">README</a>.</p>
151
138
  <p>Threads - supports profiling multiple threads simultaneously</p>
152
139
  </li></ul>
153
140
 
154
- <h2 id="label-Requirements">Requirements</h2>
141
+ <h2 id="label-Requirements">Requirements<span><a href="#label-Requirements">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
155
142
 
156
- <p>ruby-prof requires Ruby 1.8.7 or 1.9.2 and higher.</p>
143
+ <p>ruby-prof requires Ruby 1.9.3 or higher.</p>
157
144
 
158
145
  <p>If you are running Linux or Unix you&#39;ll need a C compiler so the
159
146
  extension can be compiled when it is installed.</p>
@@ -162,7 +149,7 @@ extension can be compiled when it is installed.</p>
162
149
  specific RubyGem which includes an already built extension (see Install
163
150
  section).</p>
164
151
 
165
- <h2 id="label-Install">Install</h2>
152
+ <h2 id="label-Install">Install<span><a href="#label-Install">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
166
153
 
167
154
  <p>The easiest way to install ruby-prof is by using Ruby Gems. To install:</p>
168
155
 
@@ -171,17 +158,17 @@ section).</p>
171
158
  <p>If you&#39;re on windows then a prebuilt binary gem is available. You may
172
159
  of course compile it yourself via use of devkit on MinGW.</p>
173
160
 
174
- <h2 id="label-Usage">Usage</h2>
161
+ <h2 id="label-Usage">Usage<span><a href="#label-Usage">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
175
162
 
176
163
  <p>There are two ways of running ruby-prof, via the command line or via its
177
164
  API.</p>
178
165
 
179
- <h3 id="label-ruby-prof+executable">ruby-prof executable</h3>
166
+ <h3 id="label-ruby-prof+executable">ruby-prof executable<span><a href="#label-ruby-prof+executable">&para;</a> <a href="#documentation">&uarr;</a></span></h3>
180
167
 
181
168
  <p>The first is to use ruby-prof to run the Ruby program you want to profile.
182
169
  For more information refer to the documentation of the ruby-prof command.</p>
183
170
 
184
- <h3 id="label-ruby-prof+API">ruby-prof API</h3>
171
+ <h3 id="label-ruby-prof+API">ruby-prof API<span><a href="#label-ruby-prof+API">&para;</a> <a href="#documentation">&uarr;</a></span></h3>
185
172
 
186
173
  <p>The second way is to use the ruby-prof API to profile particular segments
187
174
  of code.</p>
@@ -246,7 +233,7 @@ yet started. In addition, resume can also take a block:</p>
246
233
  <p>With this usage, resume will automatically call pause at the end of the
247
234
  block.</p>
248
235
 
249
- <h2 id="label-Method+and+Thread+Elimination">Method and Thread Elimination</h2>
236
+ <h2 id="label-Method+and+Thread+Elimination">Method and Thread Elimination<span><a href="#label-Method+and+Thread+Elimination">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
250
237
 
251
238
  <p>ruby-prof supports eliminating specific methods and threads from profiling
252
239
  results. This is useful for reducing connectivity in the call graph, making
@@ -281,7 +268,7 @@ RubyProf.start</pre>
281
268
  <p>Note that the excluded threads must be specified <strong>before</strong>
282
269
  profiling.</p>
283
270
 
284
- <h2 id="label-Benchmarking+full+load+time+including+rubygems+startup+cost+%3D%3D">Benchmarking full load time including rubygems startup cost ==</h2>
271
+ <h2 id="label-Benchmarking+full+load+time+including+rubygems+startup+cost+%3D%3D">Benchmarking full load time including rubygems startup cost ==<span><a href="#label-Benchmarking+full+load+time+including+rubygems+startup+cost+%3D%3D">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
285
272
 
286
273
  <p>If you want to get a more accurate measurement of what takes all of a
287
274
  gem&#39;s bin/xxx command to load, you may want to also measure
@@ -302,7 +289,7 @@ g:192binsome_installed_gem_command</p>
302
289
  <p>$ ruby g:/192/lib/ruby/gems/1.9.1/gems/ruby-prof-0.10.2/bin/ruby-prof
303
290
  ./some_file_that_does_a_require_rubygems_at_the_beginning.rb</p>
304
291
 
305
- <h2 id="label-Profiling+Tests">Profiling Tests</h2>
292
+ <h2 id="label-Profiling+Tests">Profiling Tests<span><a href="#label-Profiling+Tests">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
306
293
 
307
294
  <p>ruby-prof supports profiling tests cases written using Ruby&#39;s built-in
308
295
  unit test framework (ie, test derived from Test::Unit::TestCase). To
@@ -322,7 +309,7 @@ profiling options, modify your test class&#39;s PROFILE_OPTIONS hash table.
322
309
  To globally change test profiling options, modify
323
310
  RubyProf::Test::PROFILE_OPTIONS.</p>
324
311
 
325
- <h2 id="label-Profiling+Rails">Profiling Rails</h2>
312
+ <h2 id="label-Profiling+Rails">Profiling Rails<span><a href="#label-Profiling+Rails">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
326
313
 
327
314
  <p>To profile a Rails application it is vital to run it using production like
328
315
  settings (cache classes, cache view lookups, etc.). Otherwise, Rail&#39;s
@@ -360,7 +347,7 @@ be generated for each request. Note that each request will overwrite the
360
347
  profiling reports created by the previous request!</p>
361
348
  </li></ol>
362
349
 
363
- <h2 id="label-Reports">Reports</h2>
350
+ <h2 id="label-Reports">Reports<span><a href="#label-Reports">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
364
351
 
365
352
  <p>ruby-prof can generate a number of different reports:</p>
366
353
  <ul><li>
@@ -416,7 +403,7 @@ href="http://github.com/ruby-prof/ruby-prof/tree/master/examples/multi.stack.htm
416
403
 
417
404
  <p>There is also a graphviz .dot visualiser.</p>
418
405
 
419
- <h2 id="label-Printers">Printers</h2>
406
+ <h2 id="label-Printers">Printers<span><a href="#label-Printers">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
420
407
 
421
408
  <p>Reports are created by printers. Supported printers include:</p>
422
409
  <ul><li>
@@ -473,7 +460,7 @@ directory path and a basename for the files it produces.</p>
473
460
  <span class="ruby-identifier">printer</span>.<span class="ruby-identifier">print</span>(:<span class="ruby-identifier">path</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;.&quot;</span>, :<span class="ruby-identifier">profile</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;profile&quot;</span>)
474
461
  </pre>
475
462
 
476
- <h2 id="label-Measurements">Measurements</h2>
463
+ <h2 id="label-Measurements">Measurements<span><a href="#label-Measurements">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
477
464
 
478
465
  <p>Depending on the mode and platform, ruby-prof can measure various aspects
479
466
  of a Ruby program. Supported measurements include:</p>
@@ -604,7 +591,7 @@ variable:</p>
604
591
 
605
592
  <pre>RubyProf.cpu_frequency = &lt;value&gt;</pre>
606
593
 
607
- <h2 id="label-Multi-threaded+Applications">Multi-threaded Applications</h2>
594
+ <h2 id="label-Multi-threaded+Applications">Multi-threaded Applications<span><a href="#label-Multi-threaded+Applications">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
608
595
 
609
596
  <p>Unfortunately, Ruby does not provide an internal api for detecting thread
610
597
  context switches in 1.8. As a result, the timings ruby-prof reports for
@@ -615,7 +602,7 @@ the 2 seconds will be assigned to the foreground thread and not the newly
615
602
  created background thread. These errors can largely be avoided if the
616
603
  background thread performs any operation before going to sleep.</p>
617
604
 
618
- <h2 id="label-Performance">Performance</h2>
605
+ <h2 id="label-Performance">Performance<span><a href="#label-Performance">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
619
606
 
620
607
  <p>Significant effort has been put into reducing ruby-prof&#39;s overhead as
621
608
  much as possible. Our tests show that the overhead associated with
@@ -623,11 +610,11 @@ profiling code varies considerably with the code being profiled. Most
623
610
  programs will run approximately twice as slow while highly recursive
624
611
  programs (like the fibonacci series test) will run three times slower.</p>
625
612
 
626
- <h2 id="label-License">License</h2>
613
+ <h2 id="label-License">License<span><a href="#label-License">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
627
614
 
628
615
  <p>See <a href="LICENSE.html">LICENSE</a> for license information.</p>
629
616
 
630
- <h2 id="label-Development">Development</h2>
617
+ <h2 id="label-Development">Development<span><a href="#label-Development">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
631
618
 
632
619
  <p>Code is located at <a
633
620
  href="https://github.com/ruby-prof/ruby-prof">github.com/ruby-prof/ruby-prof</a></p>
@@ -635,14 +622,13 @@ href="https://github.com/ruby-prof/ruby-prof">github.com/ruby-prof/ruby-prof</a>
635
622
  <p>Google group/mailing list: <a
636
623
  href="http://groups.google.com/group/ruby-optimization">groups.google.com/group/ruby-optimization</a>
637
624
  or start a github issue.</p>
638
-
639
- </div>
625
+ </main>
640
626
 
641
627
 
642
628
 
643
- <footer id="validator-badges">
644
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
645
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
646
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
629
+ <footer id="validator-badges" role="contentinfo">
630
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
631
+ <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
632
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
647
633
  </footer>
648
634