2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
import{_ as a,a as t,b as r,ag as n}from"./chunks/framework.BcrMLAmg.js";const u=JSON.parse('{"title":"BaseElement","description":"","frontmatter":{},"headers":[],"relativePath":"references/plugins/benchmark.md","filePath":"references/plugins/benchmark.md","lastUpdated":1757840145000}'),o={name:"references/plugins/benchmark.md"};function s(h,e,i,l,d,m){return r(),t("div",null,e[0]||(e[0]=[n('<h1 id="baseelement" tabindex="-1">BaseElement <a class="header-anchor" href="#baseelement" aria-label="Permalink to "BaseElement""></a></h1><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to "Functions""></a></h2><table tabindex="0"><thead><tr><th>Method</th><th>Returns</th><th>Description</th></tr></thead><tbody><tr><td><a href="#baseelement-startprofile-methodname">BaseElement:startProfile</a></td><td>BaseElement</td><td>Starts timing a method call</td></tr><tr><td><a href="#baseelement-endprofile-methodname">BaseElement:endProfile</a></td><td>BaseElement</td><td>Ends timing a method call and records statistics</td></tr><tr><td><a href="#baseelement-benchmark-methodname">BaseElement:benchmark</a></td><td>BaseElement</td><td>Enables performance measurement for a method</td></tr><tr><td><a href="#baseelement-logbenchmark-methodname">BaseElement:logBenchmark</a></td><td>BaseElement</td><td>Logs benchmark statistics for a method</td></tr><tr><td><a href="#baseelement-stopbenchmark-methodname">BaseElement:stopBenchmark</a></td><td>BaseElement</td><td>Disables performance measurement for a method</td></tr><tr><td><a href="#baseelement-getbenchmarkstats-methodname">BaseElement:getBenchmarkStats</a></td><td>stats</td><td>Retrieves benchmark statistics for a method</td></tr></tbody></table><h2 id="baseelement-startprofile-methodname" tabindex="-1">BaseElement:startProfile(methodName) <a class="header-anchor" href="#baseelement-startprofile-methodname" aria-label="Permalink to "BaseElement:startProfile(methodName)""></a></h2><p>Starts profiling a method</p><h3 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>methodName</code> <code>string</code> The name of the method to profile</li></ul><h3 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h3><ul><li><code>BaseElement</code> <code>self</code> The element instance</li></ul><h2 id="baseelement-endprofile-methodname" tabindex="-1">BaseElement:endProfile(methodName) <a class="header-anchor" href="#baseelement-endprofile-methodname" aria-label="Permalink to "BaseElement:endProfile(methodName)""></a></h2><p>Ends profiling a method</p><h3 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>methodName</code> <code>string</code> The name of the method to stop profiling</li></ul><h3 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to "Returns""></a></h3><ul><li><code>BaseElement</code> <code>self</code> The element instance</li></ul><h2 id="baseelement-benchmark-methodname" tabindex="-1">BaseElement:benchmark(methodName) <a class="header-anchor" href="#baseelement-benchmark-methodname" aria-label="Permalink to "BaseElement:benchmark(methodName)""></a></h2><p>Enables benchmarking for a method</p><h3 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>methodName</code> <code>string</code> The name of the method to benchmark</li></ul><h3 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-label="Permalink to "Returns""></a></h3><ul><li><code>BaseElement</code> <code>self</code> The element instance</li></ul><h3 id="usage" tabindex="-1">Usage <a class="header-anchor" href="#usage" aria-label="Permalink to "Usage""></a></h3><div class="language-lua vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">lua</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">element</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">benchmark</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"render"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><h2 id="baseelement-logbenchmark-methodname" tabindex="-1">BaseElement:logBenchmark(methodName) <a class="header-anchor" href="#baseelement-logbenchmark-methodname" aria-label="Permalink to "BaseElement:logBenchmark(methodName)""></a></h2><p>Logs benchmark statistics for a method</p><h3 id="parameters-3" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-3" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>methodName</code> <code>string</code> The name of the method to log</li></ul><h3 id="returns-3" tabindex="-1">Returns <a class="header-anchor" href="#returns-3" aria-label="Permalink to "Returns""></a></h3><ul><li><code>BaseElement</code> <code>self</code> The element instance</li></ul><h2 id="baseelement-stopbenchmark-methodname" tabindex="-1">BaseElement:stopBenchmark(methodName) <a class="header-anchor" href="#baseelement-stopbenchmark-methodname" aria-label="Permalink to "BaseElement:stopBenchmark(methodName)""></a></h2><p>Stops benchmarking for a method</p><h3 id="parameters-4" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-4" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>methodName</code> <code>string</code> The name of the method to stop benchmarking</li></ul><h3 id="returns-4" tabindex="-1">Returns <a class="header-anchor" href="#returns-4" aria-label="Permalink to "Returns""></a></h3><ul><li><code>BaseElement</code> <code>self</code> The element instance</li></ul><h2 id="baseelement-getbenchmarkstats-methodname" tabindex="-1">BaseElement:getBenchmarkStats(methodName) <a class="header-anchor" href="#baseelement-getbenchmarkstats-methodname" aria-label="Permalink to "BaseElement:getBenchmarkStats(methodName)""></a></h2><p>Gets benchmark statistics for a method</p><h3 id="parameters-5" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-5" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>methodName</code> <code>string</code> The name of the method to get statistics for</li></ul><h3 id="returns-5" tabindex="-1">Returns <a class="header-anchor" href="#returns-5" aria-label="Permalink to "Returns""></a></h3><ul><li><code>stats</code> <code>The</code> benchmark statistics or nil</li></ul><h1 id="container" tabindex="-1">Container <a class="header-anchor" href="#container" aria-label="Permalink to "Container""></a></h1><p>Extends: <code>VisualElement</code></p><h2 id="functions-1" tabindex="-1">Functions <a class="header-anchor" href="#functions-1" aria-label="Permalink to "Functions""></a></h2><table tabindex="0"><thead><tr><th>Method</th><th>Returns</th><th>Description</th></tr></thead><tbody><tr><td><a href="#container-benchmarkcontainer-methodname">Container:benchmarkContainer</a></td><td>Container</td><td>Recursively enables benchmarking</td></tr><tr><td><a href="#container-logcontainerbenchmarks-methodname">Container:logContainerBenchmarks</a></td><td>Container</td><td>Recursively logs benchmark statistics</td></tr><tr><td><a href="#container-stopcontainerbenchmark-methodname">Container:stopContainerBenchmark</a></td><td>Container</td><td>Recursively stops benchmarking</td></tr></tbody></table><h2 id="container-benchmarkcontainer-methodname" tabindex="-1">Container:benchmarkContainer(methodName) <a class="header-anchor" href="#container-benchmarkcontainer-methodname" aria-label="Permalink to "Container:benchmarkContainer(methodName)""></a></h2><p>Enables benchmarking for a container and all its children</p><h3 id="parameters-6" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-6" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>methodName</code> <code>string</code> The method to benchmark</li></ul><h3 id="returns-6" tabindex="-1">Returns <a class="header-anchor" href="#returns-6" aria-label="Permalink to "Returns""></a></h3><ul><li><code>Container</code> <code>self</code> The container instance</li></ul><h3 id="usage-1" tabindex="-1">Usage <a class="header-anchor" href="#usage-1" aria-label="Permalink to "Usage""></a></h3><div class="language-lua vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">lua</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">container</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">benchmarkContainer</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"render"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><h2 id="container-logcontainerbenchmarks-methodname" tabindex="-1">Container:logContainerBenchmarks(methodName) <a class="header-anchor" href="#container-logcontainerbenchmarks-methodname" aria-label="Permalink to "Container:logContainerBenchmarks(methodName)""></a></h2><p>Logs benchmark statistics for a container and all its children</p><h3 id="parameters-7" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-7" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>methodName</code> <code>string</code> The method to log</li></ul><h3 id="returns-7" tabindex="-1">Returns <a class="header-anchor" href="#returns-7" aria-label="Permalink to "Returns""></a></h3><ul><li><code>Container</code> <code>self</code> The container instance</li></ul><h2 id="container-stopcontainerbenchmark-methodname" tabindex="-1">Container:stopContainerBenchmark(methodName) <a class="header-anchor" href="#container-stopcontainerbenchmark-methodname" aria-label="Permalink to "Container:stopContainerBenchmark(methodName)""></a></h2><p>Stops benchmarking for a container and all its children</p><h3 id="parameters-8" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-8" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>methodName</code> <code>string</code> The method to stop benchmarking</li></ul><h3 id="returns-8" tabindex="-1">Returns <a class="header-anchor" href="#returns-8" aria-label="Permalink to "Returns""></a></h3><ul><li><code>Container</code> <code>self</code> The container instance</li></ul><h1 id="benchmark" tabindex="-1">Benchmark <a class="header-anchor" href="#benchmark" aria-label="Permalink to "Benchmark""></a></h1><p><em>This is the benchmark plugin. It provides performance measurement tools for elements and methods,</em><em>with support for hierarchical profiling and detailed statistics. The plugin is meant to be used for very big projects</em><em>where performance is critical. It allows you to measure the time taken by specific methods and log the results.</em></p><h2 id="functions-2" tabindex="-1">Functions <a class="header-anchor" href="#functions-2" aria-label="Permalink to "Functions""></a></h2><table tabindex="0"><thead><tr><th>Method</th><th>Returns</th><th>Description</th></tr></thead><tbody><tr><td><a href="#benchmark-start-name-options">Benchmark.start</a></td><td>-</td><td>Starts timing a custom operation</td></tr><tr><td><a href="#benchmark-stop-name">Benchmark.stop</a></td><td>-</td><td>Stops timing and logs results</td></tr><tr><td><a href="#benchmark-getstats-name">Benchmark.getStats</a></td><td>stats</td><td>Retrieves benchmark statistics</td></tr><tr><td><a href="#benchmark-clear-name">Benchmark.clear</a></td><td>-</td><td>Removes a benchmark's data</td></tr><tr><td><a href="#benchmark-clearall">Benchmark.clearAll</a></td><td>-</td><td>Removes all custom benchmark data</td></tr></tbody></table><h2 id="benchmark-start-name-options" tabindex="-1">Benchmark.start(name, options?) <a class="header-anchor" href="#benchmark-start-name-options" aria-label="Permalink to "Benchmark.start(name, options?)""></a></h2><p>Starts a custom benchmark</p><h3 id="parameters-9" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-9" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>name</code> <code>string</code> The name of the benchmark</li><li><code>options</code> <em>(optional)</em> <code>table</code> Optional configuration</li></ul><h2 id="benchmark-stop-name" tabindex="-1">Benchmark.stop(name) <a class="header-anchor" href="#benchmark-stop-name" aria-label="Permalink to "Benchmark.stop(name)""></a></h2><p>Stops a custom benchmark</p><h3 id="parameters-10" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-10" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>name</code> <code>string</code> The name of the benchmark to stop</li></ul><h2 id="benchmark-getstats-name" tabindex="-1">Benchmark.getStats(name) <a class="header-anchor" href="#benchmark-getstats-name" aria-label="Permalink to "Benchmark.getStats(name)""></a></h2><p>Gets statistics for a benchmark</p><h3 id="parameters-11" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-11" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>name</code> <code>string</code> The name of the benchmark</li></ul><h3 id="returns-9" tabindex="-1">Returns <a class="header-anchor" href="#returns-9" aria-label="Permalink to "Returns""></a></h3><ul><li><code>stats</code> <code>The</code> benchmark statistics or nil</li></ul><h2 id="benchmark-clear-name" tabindex="-1">Benchmark.clear(name) <a class="header-anchor" href="#benchmark-clear-name" aria-label="Permalink to "Benchmark.clear(name)""></a></h2><p>Clears a specific benchmark</p><h3 id="parameters-12" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-12" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>name</code> <code>string</code> The name of the benchmark to clear</li></ul><h2 id="benchmark-clearall" tabindex="-1">Benchmark.clearAll() <a class="header-anchor" href="#benchmark-clearall" aria-label="Permalink to "Benchmark.clearAll()""></a></h2><p>Clears all custom benchmarks</p>',89)]))}const b=a(o,[["render",s]]);export{u as __pageData,b as default};
|