ruby-prof 0.15.5 → 0.15.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -208,7 +208,7 @@ RubyProf::Result.</p>
208
208
  STDOUT.</p>
209
209
 
210
210
  <p>options - Hash of print options. See <a
211
- href="AbstractPrinter.html#method-i-setup_options">setup_options</a> for
211
+ href="AbstractPrinter.html#method-i-setup_options">setup_options</a> for
212
212
  more information.</p>
213
213
 
214
214
  <p>When profiling results that cover a large number of method calls it helps
@@ -225,7 +225,7 @@ to use the :min_percent option, for example:</p>
225
225
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">print</span>(<span class="ruby-identifier">output</span> = <span class="ruby-constant">STDOUT</span>, <span class="ruby-identifier">options</span> = {})
226
226
  <span class="ruby-ivar">@output</span> = <span class="ruby-identifier">output</span>
227
227
  <span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>)
228
-
228
+
229
229
  <span class="ruby-identifier">puts</span> <span class="ruby-string">&#39;digraph &quot;Profile&quot; {&#39;</span>
230
230
  <span class="ruby-comment">#puts &quot;label=\&quot;#{mode_name} &gt;=#{min_percent}%\\nTotal: #{total_time}\&quot;;&quot;</span>
231
231
  <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;labelloc=t;&quot;</span>
@@ -442,7 +442,7 @@ be printed out.</p>
442
442
  &lt;/style&gt;
443
443
  &lt;/head&gt;
444
444
  &lt;body&gt;
445
- &lt;h1&gt;Profile Report&lt;/h1&gt;
445
+ &lt;h1&gt;Profile Report: &lt;%= RubyProf.measure_mode_string %&gt;&lt;/h1&gt;
446
446
  &lt;!-- Threads Table --&gt;
447
447
  &lt;table&gt;
448
448
  &lt;tr&gt;
@@ -482,63 +482,67 @@ be printed out.</p>
482
482
  &lt;tbody&gt;
483
483
  &lt;% min_time = @options[:min_time] || (@options[:nonzero] ? 0.005 : nil)
484
484
  methods.sort_by(&amp;sort_method).reverse_each do |method|
485
- total_percentage = (method.total_time/total_time) * 100
486
- next if total_percentage &lt; min_percent
487
- next if min_time &amp;&amp; method.total_time &lt; min_time
488
- self_percentage = (method.self_time/total_time) * 100 %&gt;
489
-
490
- &lt;!-- Parents --&gt;
491
- &lt;% for caller in method.aggregate_parents.sort_by(&amp;:total_time)
492
- next unless caller.parent
493
- next if min_time &amp;&amp; caller.total_time &lt; min_time %&gt;
494
- &lt;tr&gt;
495
- &lt;td&gt;&amp;nbsp;&lt;/td&gt;
496
- &lt;td&gt;&amp;nbsp;&lt;/td&gt;
497
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, caller.total_time) %&gt;&lt;/td&gt;
498
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, caller.self_time) %&gt;&lt;/td&gt;
499
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, caller.wait_time) %&gt;&lt;/td&gt;
500
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, caller.children_time) %&gt;&lt;/td&gt;
501
- &lt;% called = &quot;#{caller.called}/#{method.called}&quot; %&gt;
502
- &lt;td&gt;&lt;%= sprintf(&quot;%#{CALL_WIDTH}s&quot;, called) %&gt;&lt;/td&gt;
503
- &lt;td class=&quot;method_name&quot;&gt;&lt;%= create_link(thread, total_time, caller.parent.target) %&gt;&lt;/td&gt;
504
- &lt;td&gt;&lt;%= file_link(caller.parent.target.source_file, caller.line) %&gt;&lt;/td&gt;
505
- &lt;/tr&gt;
506
- &lt;% end %&gt;
507
-
508
- &lt;tr class=&quot;method&quot;&gt;
509
- &lt;td&gt;&lt;%= sprintf(&quot;%#{PERCENTAGE_WIDTH-1}.2f\%&quot;, total_percentage) %&gt;&lt;/td&gt;
510
- &lt;td&gt;&lt;%= sprintf(&quot;%#{PERCENTAGE_WIDTH-1}.2f\%&quot;, self_percentage) %&gt;&lt;/td&gt;
511
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, method.total_time) %&gt;&lt;/td&gt;
512
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, method.self_time) %&gt;&lt;/td&gt;
513
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, method.wait_time) %&gt;&lt;/td&gt;
514
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, method.children_time) %&gt;&lt;/td&gt;
515
- &lt;td&gt;&lt;%= sprintf(&quot;%#{CALL_WIDTH}i&quot;, method.called) %&gt;&lt;/td&gt;
516
- &lt;td class=&quot;method_name&quot;&gt;
517
- &lt;a name=&quot;&lt;%= method_href(thread, method) %&gt;&quot;&gt;
518
- &lt;%= method.recursive? ? &quot;*&quot; : &quot; &quot;%&gt;&lt;%= h method.full_name %&gt;
519
- &lt;/a&gt;
520
- &lt;/td&gt;
521
- &lt;td&gt;&lt;%= file_link(method.source_file, method.line) %&gt;&lt;/td&gt;
522
- &lt;/tr&gt;
523
-
524
- &lt;!-- Children --&gt;
525
- &lt;% for callee in method.aggregate_children.sort_by(&amp;:total_time).reverse %&gt;
526
- &lt;% next if min_time &amp;&amp; callee.total_time &lt; min_time %&gt;
527
- &lt;tr&gt;
528
- &lt;td&gt;&amp;nbsp;&lt;/td&gt;
529
- &lt;td&gt;&amp;nbsp;&lt;/td&gt;
530
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, callee.total_time) %&gt;&lt;/td&gt;
531
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, callee.self_time) %&gt;&lt;/td&gt;
532
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, callee.wait_time) %&gt;&lt;/td&gt;
533
- &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, callee.children_time) %&gt;&lt;/td&gt;
534
- &lt;% called = &quot;#{callee.called}/#{callee.target.called}&quot; %&gt;
535
- &lt;td&gt;&lt;%= sprintf(&quot;%#{CALL_WIDTH}s&quot;, called) %&gt;&lt;/td&gt;
536
- &lt;td class=&quot;method_name&quot;&gt;&lt;%= create_link(thread, total_time, callee.target) %&gt;&lt;/td&gt;
537
- &lt;td&gt;&lt;%= file_link(method.source_file, callee.line) %&gt;&lt;/td&gt;
538
- &lt;/tr&gt;
539
- &lt;% end %&gt;
540
- &lt;!-- Create divider row --&gt;
541
- &lt;tr class=&quot;break&quot;&gt;&lt;td colspan=&quot;9&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
485
+ total_percentage = (method.total_time/total_time) * 100
486
+
487
+ next if total_percentage &lt; min_percent
488
+ next if min_time &amp;&amp; method.total_time &lt; min_time
489
+
490
+ self_percentage = (method.self_time/total_time) * 100 %&gt;
491
+
492
+ &lt;!-- Parents --&gt;
493
+ &lt;% for caller in method.aggregate_parents.sort_by(&amp;:total_time)
494
+ next unless caller.parent
495
+ next if min_time &amp;&amp; caller.total_time &lt; min_time %&gt;
496
+ &lt;tr&gt;
497
+ &lt;td&gt;&amp;nbsp;&lt;/td&gt;
498
+ &lt;td&gt;&amp;nbsp;&lt;/td&gt;
499
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, caller.total_time) %&gt;&lt;/td&gt;
500
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, caller.self_time) %&gt;&lt;/td&gt;
501
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, caller.wait_time) %&gt;&lt;/td&gt;
502
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, caller.children_time) %&gt;&lt;/td&gt;
503
+ &lt;% called = &quot;#{caller.called}/#{method.called}&quot; %&gt;
504
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{CALL_WIDTH}s&quot;, called) %&gt;&lt;/td&gt;
505
+ &lt;td class=&quot;method_name&quot;&gt;&lt;%= create_link(thread, total_time, caller.parent.target) %&gt;&lt;/td&gt;
506
+ &lt;td&gt;&lt;%= file_link(caller.parent.target.source_file, caller.line) %&gt;&lt;/td&gt;
507
+ &lt;/tr&gt;
508
+ &lt;% end %&gt;
509
+
510
+ &lt;tr class=&quot;method&quot;&gt;
511
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{PERCENTAGE_WIDTH-1}.2f\%&quot;, total_percentage) %&gt;&lt;/td&gt;
512
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{PERCENTAGE_WIDTH-1}.2f\%&quot;, self_percentage) %&gt;&lt;/td&gt;
513
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, method.total_time) %&gt;&lt;/td&gt;
514
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, method.self_time) %&gt;&lt;/td&gt;
515
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, method.wait_time) %&gt;&lt;/td&gt;
516
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, method.children_time) %&gt;&lt;/td&gt;
517
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{CALL_WIDTH}i&quot;, method.called) %&gt;&lt;/td&gt;
518
+ &lt;td class=&quot;method_name&quot;&gt;
519
+ &lt;a name=&quot;&lt;%= method_href(thread, method) %&gt;&quot;&gt;
520
+ &lt;%= method.recursive? ? &quot;*&quot; : &quot; &quot;%&gt;&lt;%= h method.full_name %&gt;
521
+ &lt;/a&gt;
522
+ &lt;/td&gt;
523
+ &lt;td&gt;&lt;%= file_link(method.source_file, method.line) %&gt;&lt;/td&gt;
524
+ &lt;/tr&gt;
525
+
526
+ &lt;!-- Children --&gt;
527
+ &lt;% method.recalc_recursion unless method.non_recursive? %&gt;
528
+ &lt;% for callee in method.aggregate_children.sort_by(&amp;:total_time).reverse %&gt;
529
+ &lt;% next if min_time &amp;&amp; callee.total_time &lt; min_time %&gt;
530
+ &lt;tr&gt;
531
+ &lt;td&gt;&amp;nbsp;&lt;/td&gt;
532
+ &lt;td&gt;&amp;nbsp;&lt;/td&gt;
533
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, callee.total_time) %&gt;&lt;/td&gt;
534
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, callee.self_time) %&gt;&lt;/td&gt;
535
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, callee.wait_time) %&gt;&lt;/td&gt;
536
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{TIME_WIDTH}.2f&quot;, callee.children_time) %&gt;&lt;/td&gt;
537
+ &lt;% called = &quot;#{callee.called}/#{callee.target.called}&quot; %&gt;
538
+ &lt;td&gt;&lt;%= sprintf(&quot;%#{CALL_WIDTH}s&quot;, called) %&gt;&lt;/td&gt;
539
+ &lt;td class=&quot;method_name&quot;&gt;&lt;%= create_link(thread, total_time, callee.target) %&gt;&lt;/td&gt;
540
+ &lt;td&gt;&lt;%= file_link(method.source_file, callee.line) %&gt;&lt;/td&gt;
541
+ &lt;/tr&gt;
542
+ &lt;% end %&gt;
543
+ &lt;!-- Create divider row --&gt;
544
+ &lt;tr class=&quot;break&quot;&gt;&lt;td colspan=&quot;9&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
545
+ &lt;% thread.recalc_recursion unless method.non_recursive? %&gt;
542
546
  &lt;% end %&gt;
543
547
  &lt;/tbody&gt;
544
548
  &lt;tfoot&gt;
@@ -93,10 +93,22 @@
93
93
 
94
94
  <li ><a href="#method-i-children_time">#children_time</a>
95
95
 
96
+ <li ><a href="#method-i-clear_cached_values_which_depend_on_recursiveness">#clear_cached_values_which_depend_on_recursiveness</a>
97
+
98
+ <li ><a href="#method-i-detect_recursion">#detect_recursion</a>
99
+
96
100
  <li ><a href="#method-i-eliminate-21">#eliminate!</a>
97
101
 
98
102
  <li ><a href="#method-i-min_depth">#min_depth</a>
99
103
 
104
+ <li ><a href="#method-i-non_recursive">#non_recursive</a>
105
+
106
+ <li ><a href="#method-i-non_recursive-3F">#non_recursive?</a>
107
+
108
+ <li ><a href="#method-i-parents">#parents</a>
109
+
110
+ <li ><a href="#method-i-recalc_recursion">#recalc_recursion</a>
111
+
100
112
  <li ><a href="#method-i-recursive-3F">#recursive?</a>
101
113
 
102
114
  <li ><a href="#method-i-root-3F">#root?</a>
@@ -205,13 +217,12 @@
205
217
 
206
218
 
207
219
  <div class="method-source-code" id="aggregate_children-source">
208
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 105</span>
220
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 120</span>
209
221
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">aggregate_children</span>
210
222
  <span class="ruby-comment"># Group call info&#39;s based on their targets</span>
211
- <span class="ruby-identifier">groups</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hash</span>, <span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
223
+ <span class="ruby-identifier">groups</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">each_with_object</span>({}) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span>, <span class="ruby-identifier">hash</span><span class="ruby-operator">|</span>
212
224
  <span class="ruby-identifier">key</span> = <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">target</span>
213
225
  (<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> []) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">call_info</span>
214
- <span class="ruby-identifier">hash</span>
215
226
  <span class="ruby-keyword">end</span>
216
227
 
217
228
  <span class="ruby-identifier">groups</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
@@ -247,13 +258,12 @@
247
258
 
248
259
 
249
260
  <div class="method-source-code" id="aggregate_parents-source">
250
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 92</span>
261
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 108</span>
251
262
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">aggregate_parents</span>
252
263
  <span class="ruby-comment"># Group call info&#39;s based on their parents</span>
253
- <span class="ruby-identifier">groups</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hash</span>, <span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
264
+ <span class="ruby-identifier">groups</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">each_with_object</span>({}) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span>, <span class="ruby-identifier">hash</span><span class="ruby-operator">|</span>
254
265
  <span class="ruby-identifier">key</span> = <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">parent</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">target</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">self</span>
255
266
  (<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> []) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">call_info</span>
256
- <span class="ruby-identifier">hash</span>
257
267
  <span class="ruby-keyword">end</span>
258
268
 
259
269
  <span class="ruby-identifier">groups</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
@@ -289,7 +299,7 @@
289
299
 
290
300
 
291
301
  <div class="method-source-code" id="called-source">
292
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 20</span>
302
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 32</span>
293
303
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">called</span>
294
304
  <span class="ruby-ivar">@called</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
295
305
  <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sum</span>, <span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
@@ -326,13 +336,9 @@
326
336
 
327
337
 
328
338
  <div class="method-source-code" id="children-source">
329
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 84</span>
339
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 100</span>
330
340
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">children</span>
331
- <span class="ruby-ivar">@children</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
332
- <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
333
- <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">children</span>
334
- <span class="ruby-keyword">end</span>.<span class="ruby-identifier">flatten</span>
335
- <span class="ruby-keyword">end</span>
341
+ <span class="ruby-ivar">@children</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:children</span>).<span class="ruby-identifier">flatten</span>
336
342
  <span class="ruby-keyword">end</span></pre>
337
343
  </div>
338
344
 
@@ -363,11 +369,11 @@
363
369
 
364
370
 
365
371
  <div class="method-source-code" id="children_time-source">
366
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 55</span>
372
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 67</span>
367
373
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">children_time</span>
368
374
  <span class="ruby-ivar">@children_time</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
369
375
  <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sum</span>, <span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
370
- <span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">children_time</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">recursive</span>
376
+ <span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">children_time</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">recursive</span>
371
377
  <span class="ruby-identifier">sum</span>
372
378
  <span class="ruby-keyword">end</span>
373
379
  <span class="ruby-keyword">end</span>
@@ -379,6 +385,72 @@
379
385
 
380
386
 
381
387
 
388
+ </div>
389
+
390
+
391
+ <div id="method-i-clear_cached_values_which_depend_on_recursiveness" class="method-detail ">
392
+
393
+ <div class="method-heading">
394
+ <span class="method-name">clear_cached_values_which_depend_on_recursiveness</span><span
395
+ class="method-args">()</span>
396
+
397
+ <span class="method-click-advice">click to toggle source</span>
398
+
399
+ </div>
400
+
401
+
402
+ <div class="method-description">
403
+
404
+
405
+
406
+
407
+
408
+
409
+ <div class="method-source-code" id="clear_cached_values_which_depend_on_recursiveness-source">
410
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 28</span>
411
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">clear_cached_values_which_depend_on_recursiveness</span>
412
+ <span class="ruby-ivar">@total_time</span> = <span class="ruby-ivar">@self_time</span> = <span class="ruby-ivar">@wait_time</span> = <span class="ruby-ivar">@children_time</span> = <span class="ruby-keyword">nil</span>
413
+ <span class="ruby-keyword">end</span></pre>
414
+ </div>
415
+
416
+ </div>
417
+
418
+
419
+
420
+
421
+ </div>
422
+
423
+
424
+ <div id="method-i-detect_recursion" class="method-detail ">
425
+
426
+ <div class="method-heading">
427
+ <span class="method-name">detect_recursion</span><span
428
+ class="method-args">()</span>
429
+
430
+ <span class="method-click-advice">click to toggle source</span>
431
+
432
+ </div>
433
+
434
+
435
+ <div class="method-description">
436
+
437
+
438
+
439
+
440
+
441
+
442
+ <div class="method-source-code" id="detect_recursion-source">
443
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 20</span>
444
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">detect_recursion</span>
445
+ <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">each</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:detect_recursion</span>)
446
+ <span class="ruby-keyword">end</span></pre>
447
+ </div>
448
+
449
+ </div>
450
+
451
+
452
+
453
+
382
454
  </div>
383
455
 
384
456
 
@@ -401,7 +473,7 @@
401
473
 
402
474
 
403
475
  <div class="method-source-code" id="eliminate-21-source">
404
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 123</span>
476
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 137</span>
405
477
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">eliminate!</span>
406
478
  <span class="ruby-comment"># $stderr.puts &quot;eliminating #{self}&quot;</span>
407
479
  <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">eliminate!</span> }
@@ -436,11 +508,141 @@
436
508
 
437
509
 
438
510
  <div class="method-source-code" id="min_depth-source">
439
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 64</span>
511
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 76</span>
440
512
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">min_depth</span>
441
- <span class="ruby-ivar">@min_depth</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
442
- <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">depth</span>
443
- <span class="ruby-keyword">end</span>.<span class="ruby-identifier">min</span>
513
+ <span class="ruby-ivar">@min_depth</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:depth</span>).<span class="ruby-identifier">min</span>
514
+ <span class="ruby-keyword">end</span></pre>
515
+ </div>
516
+
517
+ </div>
518
+
519
+
520
+
521
+
522
+ </div>
523
+
524
+
525
+ <div id="method-i-non_recursive" class="method-detail ">
526
+
527
+ <div class="method-heading">
528
+ <span class="method-name">non_recursive</span><span
529
+ class="method-args">()</span>
530
+
531
+ <span class="method-click-advice">click to toggle source</span>
532
+
533
+ </div>
534
+
535
+
536
+ <div class="method-description">
537
+
538
+
539
+
540
+
541
+
542
+
543
+ <div class="method-source-code" id="non_recursive-source">
544
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 96</span>
545
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">non_recursive</span>
546
+ <span class="ruby-ivar">@non_recursive</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">all?</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:non_recursive?</span>) <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>
547
+ <span class="ruby-keyword">end</span></pre>
548
+ </div>
549
+
550
+ </div>
551
+
552
+
553
+
554
+
555
+ </div>
556
+
557
+
558
+ <div id="method-i-non_recursive-3F" class="method-detail ">
559
+
560
+ <div class="method-heading">
561
+ <span class="method-name">non_recursive?</span><span
562
+ class="method-args">()</span>
563
+
564
+ <span class="method-click-advice">click to toggle source</span>
565
+
566
+ </div>
567
+
568
+
569
+ <div class="method-description">
570
+
571
+
572
+
573
+
574
+
575
+
576
+ <div class="method-source-code" id="non_recursive-3F-source">
577
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 92</span>
578
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">non_recursive?</span>
579
+ <span class="ruby-identifier">non_recursive</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
580
+ <span class="ruby-keyword">end</span></pre>
581
+ </div>
582
+
583
+ </div>
584
+
585
+
586
+
587
+
588
+ </div>
589
+
590
+
591
+ <div id="method-i-parents" class="method-detail ">
592
+
593
+ <div class="method-heading">
594
+ <span class="method-name">parents</span><span
595
+ class="method-args">()</span>
596
+
597
+ <span class="method-click-advice">click to toggle source</span>
598
+
599
+ </div>
600
+
601
+
602
+ <div class="method-description">
603
+
604
+
605
+
606
+
607
+
608
+
609
+ <div class="method-source-code" id="parents-source">
610
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 104</span>
611
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">parents</span>
612
+ <span class="ruby-ivar">@parents</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:parent</span>)
613
+ <span class="ruby-keyword">end</span></pre>
614
+ </div>
615
+
616
+ </div>
617
+
618
+
619
+
620
+
621
+ </div>
622
+
623
+
624
+ <div id="method-i-recalc_recursion" class="method-detail ">
625
+
626
+ <div class="method-heading">
627
+ <span class="method-name">recalc_recursion</span><span
628
+ class="method-args">()</span>
629
+
630
+ <span class="method-click-advice">click to toggle source</span>
631
+
632
+ </div>
633
+
634
+
635
+ <div class="method-description">
636
+
637
+
638
+
639
+
640
+
641
+
642
+ <div class="method-source-code" id="recalc_recursion-source">
643
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 24</span>
644
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">recalc_recursion</span>
645
+ <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">each</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:recalc_recursion</span>)
444
646
  <span class="ruby-keyword">end</span></pre>
445
647
  </div>
446
648
 
@@ -471,11 +673,9 @@
471
673
 
472
674
 
473
675
  <div class="method-source-code" id="recursive-3F-source">
474
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 78</span>
676
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 88</span>
475
677
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">recursive?</span>
476
- <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">detect</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
477
- <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">recursive</span>
478
- <span class="ruby-keyword">end</span>
678
+ <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">detect</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:recursive</span>)
479
679
  <span class="ruby-keyword">end</span></pre>
480
680
  </div>
481
681
 
@@ -506,7 +706,7 @@
506
706
 
507
707
 
508
708
  <div class="method-source-code" id="root-3F-source">
509
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 70</span>
709
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 80</span>
510
710
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">root?</span>
511
711
  <span class="ruby-ivar">@root</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
512
712
  <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">find</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
@@ -543,11 +743,11 @@
543
743
 
544
744
 
545
745
  <div class="method-source-code" id="self_time-source">
546
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 37</span>
746
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 49</span>
547
747
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">self_time</span>
548
748
  <span class="ruby-ivar">@self_time</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
549
749
  <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sum</span>, <span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
550
- <span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">self_time</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">recursive</span>
750
+ <span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">self_time</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">recursive</span>
551
751
  <span class="ruby-identifier">sum</span>
552
752
  <span class="ruby-keyword">end</span>
553
753
  <span class="ruby-keyword">end</span>
@@ -581,7 +781,7 @@
581
781
 
582
782
 
583
783
  <div class="method-source-code" id="to_s-source">
584
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 118</span>
784
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 132</span>
585
785
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
586
786
  <span class="ruby-node">&quot;#{self.full_name} (c: #{self.called}, tt: #{self.total_time}, st: #{self.self_time}, ct: #{self.children_time})&quot;</span>
587
787
  <span class="ruby-keyword">end</span></pre>
@@ -614,7 +814,7 @@
614
814
 
615
815
 
616
816
  <div class="method-source-code" id="total_time-source">
617
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 28</span>
817
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 40</span>
618
818
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">total_time</span>
619
819
  <span class="ruby-ivar">@total_time</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
620
820
  <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sum</span>, <span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>
@@ -652,7 +852,7 @@
652
852
 
653
853
 
654
854
  <div class="method-source-code" id="wait_time-source">
655
- <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 46</span>
855
+ <pre><span class="ruby-comment"># File lib/ruby-prof/method_info.rb, line 58</span>
656
856
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">wait_time</span>
657
857
  <span class="ruby-ivar">@wait_time</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
658
858
  <span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sum</span>, <span class="ruby-identifier">call_info</span><span class="ruby-operator">|</span>