Skip to content

Commit cb9aacc

Browse files
committed
1 parent 6c6a1e4 commit cb9aacc

File tree

18 files changed

+2526
-137
lines changed

18 files changed

+2526
-137
lines changed

404.html

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
<link rel="icon" href="/assets/images/favicon.png">
20-
<meta name="generator" content="zensical-0.0.21">
20+
<meta name="generator" content="zensical-0.0.23">
2121

2222

2323

@@ -28,7 +28,7 @@
2828

2929

3030

31-
<link rel="stylesheet" href="/assets/stylesheets/modern/main.f28b7ce3.min.css">
31+
<link rel="stylesheet" href="/assets/stylesheets/modern/main.1e989742.min.css">
3232

3333

3434

@@ -388,6 +388,60 @@
388388

389389

390390

391+
<li class="md-nav__item">
392+
<a href="/history/" class="md-nav__link">
393+
394+
395+
396+
<span class="md-ellipsis">
397+
398+
399+
History
400+
401+
402+
403+
</span>
404+
405+
406+
407+
</a>
408+
</li>
409+
410+
411+
412+
413+
414+
415+
416+
417+
418+
<li class="md-nav__item">
419+
<a href="/alternatives/" class="md-nav__link">
420+
421+
422+
423+
<span class="md-ellipsis">
424+
425+
426+
Alternatives
427+
428+
429+
430+
</span>
431+
432+
433+
434+
</a>
435+
</li>
436+
437+
438+
439+
440+
441+
442+
443+
444+
391445
<li class="md-nav__item">
392446
<a href="/changelog/" class="md-nav__link">
393447

@@ -481,7 +535,7 @@ <h1>404 - Not found</h1>
481535
<script id="__config" type="application/json">{"annotate":null,"base":"/","features":[],"search":"/assets/javascripts/workers/search.e2d2d235.min.js","tags":null,"translations":{"clipboard.copied":"Copied to clipboard","clipboard.copy":"Copy to clipboard","search.result.more.one":"1 more on this page","search.result.more.other":"# more on this page","search.result.none":"No matching documents","search.result.one":"1 matching document","search.result.other":"# matching documents","search.result.placeholder":"Type to start searching","search.result.term.missing":"Missing","select.version":"Select version"},"version":null}</script>
482536

483537

484-
<script src="/assets/javascripts/bundle.36a64b72.min.js"></script>
538+
<script src="/assets/javascripts/bundle.5fcf0de6.min.js"></script>
485539

486540

487541
</body>

advanced-usage/index.html

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
<link rel="icon" href="../assets/images/favicon.png">
26-
<meta name="generator" content="zensical-0.0.21">
26+
<meta name="generator" content="zensical-0.0.23">
2727

2828

2929

@@ -34,7 +34,7 @@
3434

3535

3636

37-
<link rel="stylesheet" href="../assets/stylesheets/modern/main.f28b7ce3.min.css">
37+
<link rel="stylesheet" href="../assets/stylesheets/modern/main.1e989742.min.css">
3838

3939

4040

@@ -101,7 +101,7 @@
101101

102102
<header class="md-header md-header--shadow" data-md-component="header">
103103
<nav class="md-header__inner md-grid" aria-label="Header">
104-
<a href=".." title="ruby-prof" class="md-header__button md-logo" aria-label="ruby-prof" data-md-component="logo">
104+
<a href="./.." title="ruby-prof" class="md-header__button md-logo" aria-label="ruby-prof" data-md-component="logo">
105105

106106
<img src="../public/images/ruby-prof-logo.svg" alt="logo">
107107

@@ -209,7 +209,7 @@
209209

210210
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
211211
<label class="md-nav__title" for="__drawer">
212-
<a href=".." title="ruby-prof" class="md-nav__button md-logo" aria-label="ruby-prof" data-md-component="logo">
212+
<a href="./.." title="ruby-prof" class="md-nav__button md-logo" aria-label="ruby-prof" data-md-component="logo">
213213

214214
<img src="../public/images/ruby-prof-logo.svg" alt="logo">
215215

@@ -238,7 +238,7 @@
238238

239239

240240
<li class="md-nav__item">
241-
<a href=".." class="md-nav__link">
241+
<a href="./.." class="md-nav__link">
242242

243243

244244

@@ -319,7 +319,7 @@
319319
<span class="md-nav__icon md-icon"></span>
320320
</label>
321321

322-
<a href="./" class="md-nav__link md-nav__link--active">
322+
<a href="././" class="md-nav__link md-nav__link--active">
323323

324324

325325

@@ -563,6 +563,60 @@
563563

564564

565565

566+
<li class="md-nav__item">
567+
<a href="../history/" class="md-nav__link">
568+
569+
570+
571+
<span class="md-ellipsis">
572+
573+
574+
History
575+
576+
577+
578+
</span>
579+
580+
581+
582+
</a>
583+
</li>
584+
585+
586+
587+
588+
589+
590+
591+
592+
593+
<li class="md-nav__item">
594+
<a href="../alternatives/" class="md-nav__link">
595+
596+
597+
598+
<span class="md-ellipsis">
599+
600+
601+
Alternatives
602+
603+
604+
605+
</span>
606+
607+
608+
609+
</a>
610+
</li>
611+
612+
613+
614+
615+
616+
617+
618+
619+
566620
<li class="md-nav__item">
567621
<a href="../changelog/" class="md-nav__link">
568622

@@ -758,11 +812,11 @@ <h2 id="profiling-options">Profiling Options<a class="headerlink" href="#profili
758812
<h2 id="measurement-mode">Measurement Mode<a class="headerlink" href="#measurement-mode" title="Permanent link">&para;</a></h2>
759813
<p>The measurement mode determines what ruby-prof measures when profiling code. Supported measurements are:</p>
760814
<h3 id="wall-time">Wall Time<a class="headerlink" href="#wall-time" title="Permanent link">&para;</a></h3>
761-
<p>Wall time measures the real-world time elapsed between any two moments in seconds. If there are other processes concurrently running on the system that use significant CPU or disk time during a profiling run then the reported results will be larger than expected. On Windows, wall time is measured using <code>GetTickCount()</code>, on MacOS by <code>mach_absolute_time</code>, on Linux by <code>clock_gettime</code> and otherwise by <code>gettimeofday</code>. Use <code>RubyProf::WALL_TIME</code> to select this mode.</p>
815+
<p>Wall time measures the real-world time elapsed between any two moments in seconds. If there are other processes concurrently running on the system that use significant CPU or disk time during a profiling run then the reported results will be larger than expected. On Windows, wall time is measured using <code>QueryPerformanceCounter</code> and on other platforms by <code>clock_gettime(CLOCK_MONOTONIC)</code>. Use <code>RubyProf::WALL_TIME</code> to select this mode.</p>
762816
<h3 id="process-time">Process Time<a class="headerlink" href="#process-time" title="Permanent link">&para;</a></h3>
763817
<p>Process time measures the time used by a process between any two moments in seconds. It is unaffected by other processes concurrently running on the system. Remember with process time that calls to methods like sleep will not be included in profiling results. On Windows, process time is measured using <code>GetProcessTimes</code> and on other platforms by <code>clock_gettime</code>. Use <code>RubyProf::PROCESS_TIME</code> to select this mode.</p>
764818
<h3 id="object-allocations">Object Allocations<a class="headerlink" href="#object-allocations" title="Permanent link">&para;</a></h3>
765-
<p>Object allocations measures show how many objects each method in a program allocates. Measurements are done via Ruby's <code>GC.stat</code> api. Use <code>RubyProf::ALLOCATIONS</code> to select this mode.</p>
819+
<p>Object allocations measures how many objects each method in a program allocates. Measurements are done via Ruby's <code>RUBY_INTERNAL_EVENT_NEWOBJ</code> trace event, counting each new object created (excluding internal <code>T_IMEMO</code> objects). Use <code>RubyProf::ALLOCATIONS</code> to select this mode.</p>
766820
<p>To set the measurement mode:</p>
767821
<div class="language-ruby highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">profile</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="no">RubyProf</span><span class="o">::</span><span class="no">Profile</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="ss">measure_mode</span><span class="p">:</span><span class="w"> </span><span class="no">RubyProf</span><span class="o">::</span><span class="no">WALL_TIME</span><span class="p">)</span>
768822
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="n">profile</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="no">RubyProf</span><span class="o">::</span><span class="no">Profile</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="ss">measure_mode</span><span class="p">:</span><span class="w"> </span><span class="no">RubyProf</span><span class="o">::</span><span class="no">PROCESS_TIME</span><span class="p">)</span>
@@ -807,10 +861,10 @@ <h2 id="merging-threads-and-fibers">Merging Threads and Fibers<a class="headerli
807861
</span><span id="__span-5-4"><a id="__codelineno-5-4" name="__codelineno-5-4" href="#__codelineno-5-4"></a><span class="n">profile</span><span class="o">.</span><span class="n">merge!</span>
808862
</span></code></pre></div>
809863
<p>This is also supported in the Rack adapter via the <code>merge_fibers</code> option:</p>
810-
<div class="language-ruby highlight"><pre><span></span><code><span id="__span-6-1"><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a><span class="n">config</span><span class="o">.</span><span class="n">middleware</span><span class="o">.</span><span class="n">use</span><span class="w"> </span><span class="no">Rack</span><span class="o">::</span><span class="no">RubyProf</span><span class="p">,</span><span class="w"> </span><span class="ss">:path</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="s1">&#39;./tmp/profile&#39;</span><span class="p">,</span><span class="w"> </span><span class="ss">:merge_fibers</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="kp">true</span>
864+
<div class="language-ruby highlight"><pre><span></span><code><span id="__span-6-1"><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a><span class="n">config</span><span class="o">.</span><span class="n">middleware</span><span class="o">.</span><span class="n">use</span><span class="w"> </span><span class="no">Rack</span><span class="o">::</span><span class="no">RubyProf</span><span class="p">,</span><span class="w"> </span><span class="ss">path</span><span class="p">:</span><span class="w"> </span><span class="s1">&#39;./tmp/profile&#39;</span><span class="p">,</span><span class="w"> </span><span class="ss">merge_fibers</span><span class="p">:</span><span class="w"> </span><span class="kp">true</span>
811865
</span></code></pre></div>
812866
<h2 id="saving-results">Saving Results<a class="headerlink" href="#saving-results" title="Permanent link">&para;</a></h2>
813-
<p>It can be helpful to save the results of a profiling run for later analysis. Results can be saved using Ruby's <a href="https://ruby-doc.org/core-2.6.3/Marshal.html">marshal</a> library.</p>
867+
<p>It can be helpful to save the results of a profiling run for later analysis. Results can be saved using Ruby's <a href="https://docs.ruby-lang.org/en/master/Marshal.html">marshal</a> library.</p>
814868
<div class="language-ruby highlight"><pre><span></span><code><span id="__span-7-1"><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a><span class="n">profile_1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="no">RubyProf</span><span class="o">::</span><span class="no">Profile</span><span class="o">.</span><span class="n">profile</span><span class="w"> </span><span class="k">do</span>
815869
</span><span id="__span-7-2"><a id="__codelineno-7-2" name="__codelineno-7-2" href="#__codelineno-7-2"></a><span class="w"> </span><span class="o">...</span>
816870
</span><span id="__span-7-3"><a id="__codelineno-7-3" name="__codelineno-7-3" href="#__codelineno-7-3"></a><span class="k">end</span>
@@ -821,7 +875,7 @@ <h2 id="saving-results">Saving Results<a class="headerlink" href="#saving-result
821875
</span><span id="__span-7-8"><a id="__codelineno-7-8" name="__codelineno-7-8" href="#__codelineno-7-8"></a><span class="c1"># Sometime later load the results</span>
822876
</span><span id="__span-7-9"><a id="__codelineno-7-9" name="__codelineno-7-9" href="#__codelineno-7-9"></a><span class="n">profile_2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="no">Marshal</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
823877
</span></code></pre></div>
824-
<p><strong>!!!WARNING!!!</strong> - Only load ruby-prof profiles that you know are safe. Demarshaling data can lead to arbitrary code execution and thus can be <a href="https://ruby-doc.org/core-2.6.3/Marshal.html#module-Marshal-label-Security+considerations">dangerous</a>.</p>
878+
<p><strong>!!!WARNING!!!</strong> - Only load ruby-prof profiles that you know are safe. Demarshaling data can lead to arbitrary code execution and thus can be <a href="https://docs.ruby-lang.org/en/master/Marshal.html#module-Marshal-label-Security+considerations">dangerous</a>.</p>
825879

826880

827881

@@ -877,7 +931,7 @@ <h2 id="saving-results">Saving Results<a class="headerlink" href="#saving-result
877931
<script id="__config" type="application/json">{"annotate":null,"base":"..","features":[],"search":"../assets/javascripts/workers/search.e2d2d235.min.js","tags":null,"translations":{"clipboard.copied":"Copied to clipboard","clipboard.copy":"Copy to clipboard","search.result.more.one":"1 more on this page","search.result.more.other":"# more on this page","search.result.none":"No matching documents","search.result.one":"1 matching document","search.result.other":"# matching documents","search.result.placeholder":"Type to start searching","search.result.term.missing":"Missing","select.version":"Select version"},"version":null}</script>
878932

879933

880-
<script src="../assets/javascripts/bundle.36a64b72.min.js"></script>
934+
<script src="../assets/javascripts/bundle.5fcf0de6.min.js"></script>
881935

882936

883937
</body>

0 commit comments

Comments
 (0)