1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 10:31:53 +02:00

(v1.5.0.9024) more speed improvements

This commit is contained in:
2021-02-22 20:21:33 +01:00
parent 0fdabff1ba
commit 31ceba5441
18 changed files with 151 additions and 128 deletions

View File

@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.5.0.9023</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.5.0.9024</span>
</span>
</div>
@ -200,17 +200,17 @@
<p>One of the most important features of this package is the complete microbial taxonomic database, supplied by the <a href="http://catalogueoflife.org">Catalogue of Life</a>. We created a function <code><a href="../reference/as.mo.html">as.mo()</a></code> that transforms any user input value to a valid microbial ID by using intelligent rules combined with the taxonomic tree of Catalogue of Life.</p>
<p>Using the <code>microbenchmark</code> package, we can review the calculation performance of this function. Its function <code>microbenchmark()</code> runs different input expressions independently of each other and measures their time-to-result.</p>
<p>One of the most important features of this package is the complete microbial taxonomic database, supplied by the <a href="http://www.catalogueoflife.org">Catalogue of Life</a> (CoL) and the <a href="https://lpsn.dsmz.de">List of Prokaryotic names with Standing in Nomenclature</a> (LPSN). We created a function <code><a href="../reference/as.mo.html">as.mo()</a></code> that transforms any user input value to a valid microbial ID by using intelligent rules combined with the microbial taxonomy.</p>
<p>Using the <code>microbenchmark</code> package, we can review the calculation performance of this function. Its function <code><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark()</a></code> runs different input expressions independently of each other and measures their time-to-result.</p>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">microbenchmark</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span><span class="fu">::</span><span class="va"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span>
<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/joshuaulrich/microbenchmark/">microbenchmark</a></span><span class="op">)</span>
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://msberends.github.io/AMR/">AMR</a></span><span class="op">)</span>
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span></code></pre></div>
<p>In the next test, we try to coerce different input values into the microbial code of <em>Staphylococcus aureus</em>. Coercion is a computational process of forcing output based on an input. For microorganism names, coercing user input to taxonomically valid microorganism names is crucial to ensure correct interpretation and to enable grouping based on taxonomic properties.</p>
<p>The actual result is the same every time: it returns its microorganism code <code>B_STPHY_AURS</code> (<em>B</em> stands for <em>Bacteria</em>, the taxonomic kingdom).</p>
<p>The actual result is the same every time: it returns its microorganism code <code>B_STPHY_AURS</code> (<em>B</em> stands for <em>Bacteria</em>, its taxonomic kingdom).</p>
<p>But the calculation time differs a lot:</p>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">S.aureus</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span><span class="op">(</span>
<code class="sourceCode R"><span class="va">S.aureus</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span><span class="op">(</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"sau"</span><span class="op">)</span>, <span class="co"># WHONET code</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"stau"</span><span class="op">)</span>,
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"STAU"</span><span class="op">)</span>,
@ -223,40 +223,47 @@
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"Sthafilokkockus aaureuz"</span><span class="op">)</span>, <span class="co"># incorrect spelling</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"MRSA"</span><span class="op">)</span>, <span class="co"># Methicillin Resistant S. aureus</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"VISA"</span><span class="op">)</span>, <span class="co"># Vancomycin Intermediate S. aureus</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"VRSA"</span><span class="op">)</span>, <span class="co"># Vancomycin Resistant S. aureus</span>
times <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>
times <span class="op">=</span> <span class="fl">25</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">S.aureus</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">2</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># as.mo("sau") 11.0 12.0 27.0 13.0 49.0 51 10</span>
<span class="co"># as.mo("stau") 53.0 57.0 76.0 74.0 93.0 100 10</span>
<span class="co"># as.mo("STAU") 53.0 54.0 69.0 56.0 58.0 190 10</span>
<span class="co"># as.mo("staaur") 11.0 12.0 21.0 13.0 42.0 44 10</span>
<span class="co"># as.mo("STAAUR") 11.0 12.0 16.0 13.0 14.0 48 10</span>
<span class="co"># as.mo("S. aureus") 27.0 27.0 38.0 32.0 35.0 75 10</span>
<span class="co"># as.mo("S aureus") 27.0 29.0 38.0 30.0 36.0 73 10</span>
<span class="co"># as.mo("Staphylococcus aureus") 3.1 3.2 6.9 3.5 3.7 38 10</span>
<span class="co"># as.mo("Staphylococcus aureus (MRSA)") 250.0 260.0 270.0 260.0 280.0 290 10</span>
<span class="co"># as.mo("Sthafilokkockus aaureuz") 160.0 200.0 200.0 200.0 210.0 230 10</span>
<span class="co"># as.mo("MRSA") 10.0 11.0 12.0 11.0 13.0 14 10</span>
<span class="co"># as.mo("VISA") 19.0 20.0 26.0 22.0 24.0 61 10</span>
<span class="co"># as.mo("VRSA") 19.0 20.0 24.0 21.0 22.0 56 10</span></code></pre></div>
<p><img src="benchmarks_files/figure-html/unnamed-chunk-4-1.png" width="562.5"></p>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 100 milliseconds, this is only 10 input values per second. It is clear that accepted taxonomic names are extremely fast, but some variations can take up to 500-1000 times as much time.</p>
<p>To improve performance, two important calculations take almost no time at all: <strong>repetitive results</strong> and <strong>already precalculated results</strong>.</p>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># as.mo("sau") 9.3 10 11.0 10 11.0 13.0 25</span>
<span class="co"># as.mo("stau") 52.0 55 73.0 58 92.0 100.0 25</span>
<span class="co"># as.mo("STAU") 50.0 54 73.0 58 96.0 110.0 25</span>
<span class="co"># as.mo("staaur") 9.7 10 14.0 11 12.0 57.0 25</span>
<span class="co"># as.mo("STAAUR") 8.9 10 14.0 10 11.0 52.0 25</span>
<span class="co"># as.mo("S. aureus") 26.0 28 41.0 29 67.0 76.0 25</span>
<span class="co"># as.mo("S aureus") 27.0 28 41.0 30 65.0 76.0 25</span>
<span class="co"># as.mo("Staphylococcus aureus") 2.6 3 3.2 3 3.3 4.6 25</span>
<span class="co"># as.mo("Staphylococcus aureus (MRSA)") 240.0 260 270.0 260 270.0 380.0 25</span>
<span class="co"># as.mo("Sthafilokkockus aaureuz") 160.0 190 200.0 200 200.0 300.0 25</span>
<span class="co"># as.mo("MRSA") 9.3 10 15.0 10 12.0 49.0 25</span>
<span class="co"># as.mo("VISA") 18.0 19 31.0 21 54.0 67.0 25</span></code></pre></div>
<p><img src="benchmarks_files/figure-html/unnamed-chunk-4-1.png" width="750"></p>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 200 milliseconds, this is only 5 input values per second. It is clear that accepted taxonomic names are extremely fast, but some variations are up to 200 times slower to determine.</p>
<p>To improve performance, we implemented two important algorithms to save unnecessary calculations: <strong>repetitive results</strong> and <strong>already precalculated results</strong>.</p>
<div id="repetitive-results" class="section level3">
<h3 class="hasAnchor">
<a href="#repetitive-results" class="anchor"></a>Repetitive results</h3>
<p>Repetitive results are unique values that are present more than once. Unique values will only be calculated once by <code><a href="../reference/as.mo.html">as.mo()</a></code>. We will use <code><a href="../reference/mo_property.html">mo_name()</a></code> for this test - a helper function that returns the full microbial name (genus, species and possibly subspecies) which uses <code><a href="../reference/as.mo.html">as.mo()</a></code> internally.</p>
<p>Repetitive results are values that are present more than once in a vector. Unique values will only be calculated once by <code><a href="../reference/as.mo.html">as.mo()</a></code>. So running <code><a href="../reference/as.mo.html">as.mo(c("E. coli", "E. coli"))</a></code> will check the value <code>"E. coli"</code> only once.</p>
<p>To prove this, we will use <code><a href="../reference/mo_property.html">mo_name()</a></code> for testing - a helper function that returns the full microbial name (genus, species and possibly subspecies) which uses <code><a href="../reference/as.mo.html">as.mo()</a></code> internally.</p>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="co"># take all MO codes from the example_isolates data set</span>
<span class="va">x</span> <span class="op">&lt;-</span> <span class="va">example_isolates</span><span class="op">$</span><span class="va">mo</span> <span class="op">%&gt;%</span>
<code class="sourceCode R"><span class="co"># start with the example_isolates data set</span>
<span class="va">x</span> <span class="op">&lt;-</span> <span class="va">example_isolates</span> <span class="op">%&gt;%</span>
<span class="co"># take all MO codes from the 'mo' column</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/pull.html">pull</a></span><span class="op">(</span><span class="va">mo</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="co"># and copy them a thousand times</span>
<span class="fu"><a href="https://rdrr.io/r/base/rep.html">rep</a></span><span class="op">(</span><span class="fl">1000</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="co"># then scramble them</span>
<span class="fu"><a href="https://rdrr.io/r/base/sample.html">sample</a></span><span class="op">(</span><span class="op">)</span>
<span class="co"># what do these values look like? They are of class &lt;mo&gt;:</span>
<span class="fu"><a href="https://rdrr.io/r/utils/head.html">head</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>
<span class="co"># Class &lt;mo&gt;</span>
<span class="co"># [1] B_STPHY_AURS B_STRPT_GRPC B_STPHY_CONS B_STPHY_EPDR B_STRPT_PNMN</span>
<span class="co"># [6] B_PROTS_VLGR</span>
<span class="co"># as the example_isolates has 2,000 rows, we should have 2 million items</span>
<span class="co"># as the example_isolates data set has 2,000 rows, we should have 2 million items</span>
<span class="fu"><a href="https://rdrr.io/r/base/length.html">length</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>
<span class="co"># [1] 2000000</span>
@ -265,32 +272,32 @@
<span class="co"># [1] 90</span>
<span class="co"># now let's see:</span>
<span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>,
<span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>,
times <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">run_it</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">3</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># mo_name(x) 137 146 178 172 193 282 10</span></code></pre></div>
<p>So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.172 seconds. You only lose time on your unique input values.</p>
<span class="co"># mo_name(x) 157 187 222 206 224 372 10</span></code></pre></div>
<p>So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.206 seconds. That is 2.471 milliseconds per unique item on average. You only lose time on your unique input values.</p>
</div>
<div id="precalculated-results" class="section level3">
<h3 class="hasAnchor">
<a href="#precalculated-results" class="anchor"></a>Precalculated results</h3>
<p>What about precalculated results? If the input is an already precalculated result of a helper function like <code><a href="../reference/mo_property.html">mo_name()</a></code>, it almost doesnt take any time at all (see C below):</p>
<p>What about precalculated results? If the input is an already precalculated result of a helper function such as <code><a href="../reference/mo_property.html">mo_name()</a></code>, it almost doesnt take any time at all. In other words, if you run <code><a href="../reference/mo_property.html">mo_name()</a></code> on a valid taxonomic name, it will return the results immediately (see C below):</p>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span><span class="op">(</span>A <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"STAAUR"</span><span class="op">)</span>,
<code class="sourceCode R"><span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span><span class="op">(</span>A <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"STAAUR"</span><span class="op">)</span>,
B <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"S. aureus"</span><span class="op">)</span>,
C <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"Staphylococcus aureus"</span><span class="op">)</span>,
times <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">run_it</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">3</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># A 7.12 7.56 7.89 7.7 8.39 8.69 10</span>
<span class="co"># B 23.90 24.50 35.10 24.8 27.40 77.50 10</span>
<span class="co"># C 1.73 1.84 1.95 1.9 2.09 2.36 10</span></code></pre></div>
<p>So going from <code><a href="../reference/mo_property.html">mo_name("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0019 seconds - it doesnt even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
<span class="co"># A 6.97 7.10 7.55 7.21 8.18 8.32 10</span>
<span class="co"># B 23.70 24.20 36.30 26.30 29.00 89.70 10</span>
<span class="co"># C 1.53 1.65 1.80 1.76 2.00 2.19 10</span></code></pre></div>
<p>So going from <code><a href="../reference/mo_property.html">mo_name("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0018 seconds - it doesnt even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span><span class="op">(</span>A <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_species</a></span><span class="op">(</span><span class="st">"aureus"</span><span class="op">)</span>,
<code class="sourceCode R"><span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span><span class="op">(</span>A <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_species</a></span><span class="op">(</span><span class="st">"aureus"</span><span class="op">)</span>,
B <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="st">"Staphylococcus"</span><span class="op">)</span>,
C <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"Staphylococcus aureus"</span><span class="op">)</span>,
D <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_family</a></span><span class="op">(</span><span class="st">"Staphylococcaceae"</span><span class="op">)</span>,
@ -302,15 +309,15 @@
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">run_it</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">3</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># A 1.54 1.57 1.73 1.69 1.88 2.00 10</span>
<span class="co"># B 1.51 1.52 1.75 1.70 1.86 2.41 10</span>
<span class="co"># C 1.55 1.60 1.70 1.70 1.81 1.86 10</span>
<span class="co"># D 1.55 1.59 1.71 1.66 1.83 1.94 10</span>
<span class="co"># E 1.50 1.55 1.68 1.61 1.78 2.10 10</span>
<span class="co"># F 1.51 1.62 1.75 1.79 1.82 2.02 10</span>
<span class="co"># G 1.52 1.53 1.68 1.60 1.80 2.02 10</span>
<span class="co"># H 1.53 1.54 1.63 1.60 1.67 1.84 10</span></code></pre></div>
<p>Of course, when running <code><a href="../reference/mo_property.html">mo_phylum("Firmicutes")</a></code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> anyway, there is no point in calculating the result. And because this package knows all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.</p>
<span class="co"># A 1.44 1.72 1.69 1.74 1.75 1.78 10</span>
<span class="co"># B 1.47 1.55 1.67 1.73 1.74 1.89 10</span>
<span class="co"># C 1.52 1.59 1.73 1.74 1.89 1.91 10</span>
<span class="co"># D 1.46 1.51 1.64 1.64 1.75 1.89 10</span>
<span class="co"># E 1.42 1.47 1.60 1.52 1.71 1.97 10</span>
<span class="co"># F 1.44 1.71 1.69 1.72 1.75 1.88 10</span>
<span class="co"># G 1.42 1.50 1.68 1.61 1.73 2.36 10</span>
<span class="co"># H 1.52 1.54 1.66 1.71 1.73 1.87 10</span></code></pre></div>
<p>Of course, when running <code><a href="../reference/mo_property.html">mo_phylum("Firmicutes")</a></code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> anyway, there is no point in calculating the result. And because this package contains all phyla of all known bacteria, it can just return the initial value immediately.</p>
</div>
<div id="results-in-other-languages" class="section level3">
<h3 class="hasAnchor">
@ -326,7 +333,7 @@
<span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"nl"</span><span class="op">)</span> <span class="co"># or just mo_name("CoNS") on a Dutch system</span>
<span class="co"># [1] "Coagulase-negatieve Staphylococcus (CNS)"</span>
<span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span><span class="op">(</span>en <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"en"</span><span class="op">)</span>,
<span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span><span class="op">(</span>en <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"en"</span><span class="op">)</span>,
de <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"de"</span><span class="op">)</span>,
nl <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"nl"</span><span class="op">)</span>,
es <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"es"</span><span class="op">)</span>,
@ -336,15 +343,15 @@
times <span class="op">=</span> <span class="fl">100</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">run_it</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">4</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># en 17.38 17.71 25.63 18.11 19.75 81.61 100</span>
<span class="co"># de 20.14 20.61 24.87 20.91 21.57 85.23 100</span>
<span class="co"># nl 25.02 25.46 28.40 25.83 26.58 78.47 100</span>
<span class="co"># es 19.90 20.41 24.86 20.77 21.78 81.38 100</span>
<span class="co"># it 20.01 20.44 24.40 20.80 21.57 76.08 100</span>
<span class="co"># fr 19.85 20.23 29.97 20.89 23.56 192.40 100</span>
<span class="co"># pt 19.90 20.26 26.53 20.75 22.56 85.69 100</span></code></pre></div>
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># en 17.12 17.40 22.65 17.54 18.39 78.39 100</span>
<span class="co"># de 19.93 20.26 22.60 20.48 20.97 81.27 100</span>
<span class="co"># nl 24.87 25.24 30.93 25.50 26.90 87.17 100</span>
<span class="co"># es 20.00 20.26 24.39 20.58 21.13 82.01 100</span>
<span class="co"># it 19.92 20.26 26.54 20.66 21.38 79.15 100</span>
<span class="co"># fr 19.62 19.90 24.74 20.10 21.04 77.20 100</span>
<span class="co"># pt 19.74 20.02 26.76 20.41 22.68 82.61 100</span></code></pre></div>
<p>Currently supported non-English languages are German, Dutch, Spanish, Italian, French and Portuguese.</p>
</div>
</div>