Skip to content

Commit a815164

Browse files
New argument return_array_descriptor in run_benchmark
1 parent 5ad822a commit a815164

File tree

86 files changed

+2433
-786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2433
-786
lines changed

docs/gh-pages/_build/auto_examples/benchmarks/Benchmark_Hardware_Info.html

Lines changed: 27 additions & 26 deletions
Large diffs are not rendered by default.

docs/gh-pages/_build/auto_examples/benchmarks/Hashing.html

Lines changed: 30 additions & 29 deletions
Large diffs are not rendered by default.

docs/gh-pages/_build/auto_examples/benchmarks/Inplace_conjugate.html

Lines changed: 26 additions & 25 deletions
Large diffs are not rendered by default.

docs/gh-pages/_build/auto_examples/benchmarks/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<link rel="index" title="Index" href="../../../genindex.html" />
7676
<link rel="search" title="Search" href="../../../search.html" />
7777
<link rel="next" title="Description of the benchmark machine" href="Benchmark_Hardware_Info.html" />
78-
<link rel="prev" title="Time Trains" href="../tutorial/10-TimeTrains.html" />
78+
<link rel="prev" title="Running benchmarks manually" href="../tutorial/11-Manual_benchmarks.html" />
7979
<meta name="viewport" content="width=device-width, initial-scale=1"/>
8080
<meta name="docsearch:language" content="en"/>
8181
<meta name="docsearch:version" content="main" />
@@ -414,6 +414,7 @@
414414
<li class="toctree-l2"><a class="reference internal" href="../tutorial/08-Lengthy_benchmarks.html">Time-consuming benchmarks</a></li>
415415
<li class="toctree-l2"><a class="reference internal" href="../tutorial/09-Vector_output.html">Vector outputs</a></li>
416416
<li class="toctree-l2"><a class="reference internal" href="../tutorial/10-TimeTrains.html">Time Trains</a></li>
417+
<li class="toctree-l2"><a class="reference internal" href="../tutorial/11-Manual_benchmarks.html">Running benchmarks manually</a></li>
417418
</ul>
418419
</details></li>
419420
<li class="toctree-l1 current active has-children"><a class="current reference internal" href="#">Benchmarks</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>

docs/gh-pages/_build/auto_examples/benchmarks/numpy_array_init.html

Lines changed: 21 additions & 20 deletions
Large diffs are not rendered by default.

docs/gh-pages/_build/auto_examples/benchmarks/sg_execution_times.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@
454454

455455
<section id="computation-times">
456456
<span id="sphx-glr-build-auto-examples-benchmarks-sg-execution-times"></span><h1>Computation times<a class="headerlink" href="#computation-times" title="Link to this heading">#</a></h1>
457-
<p><strong>00:01.102</strong> total execution time for 4 files <strong>from _build/auto_examples/benchmarks</strong>:</p>
457+
<p><strong>00:01.211</strong> total execution time for 4 files <strong>from _build/auto_examples/benchmarks</strong>:</p>
458458
<div class="docutils container">
459459
<style scoped>
460460
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet" />
@@ -476,19 +476,19 @@
476476
</thead>
477477
<tbody>
478478
<tr class="row-even"><td><p><a class="reference internal" href="Inplace_conjugate.html#sphx-glr-build-auto-examples-benchmarks-inplace-conjugate-py"><span class="std std-ref">Benchmark of inplace conjugation of arrays</span></a> (<code class="docutils literal notranslate"><span class="pre">Inplace_conjugate.py</span></code>)</p></td>
479-
<td><p>00:00.548</p></td>
479+
<td><p>00:00.616</p></td>
480480
<td><p>0.0</p></td>
481481
</tr>
482482
<tr class="row-odd"><td><p><a class="reference internal" href="Hashing.html#sphx-glr-build-auto-examples-benchmarks-hashing-py"><span class="std std-ref">Time benchmark of built-in hashing in Python</span></a> (<code class="docutils literal notranslate"><span class="pre">Hashing.py</span></code>)</p></td>
483-
<td><p>00:00.345</p></td>
483+
<td><p>00:00.379</p></td>
484484
<td><p>0.0</p></td>
485485
</tr>
486486
<tr class="row-even"><td><p><a class="reference internal" href="numpy_array_init.html#sphx-glr-build-auto-examples-benchmarks-numpy-array-init-py"><span class="std std-ref">Numpy array initialization</span></a> (<code class="docutils literal notranslate"><span class="pre">numpy_array_init.py</span></code>)</p></td>
487-
<td><p>00:00.130</p></td>
487+
<td><p>00:00.139</p></td>
488488
<td><p>0.0</p></td>
489489
</tr>
490490
<tr class="row-odd"><td><p><a class="reference internal" href="Benchmark_Hardware_Info.html#sphx-glr-build-auto-examples-benchmarks-benchmark-hardware-info-py"><span class="std std-ref">Description of the benchmark machine</span></a> (<code class="docutils literal notranslate"><span class="pre">Benchmark_Hardware_Info.py</span></code>)</p></td>
491-
<td><p>00:00.079</p></td>
491+
<td><p>00:00.077</p></td>
492492
<td><p>0.0</p></td>
493493
</tr>
494494
</tbody>

docs/gh-pages/_build/auto_examples/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@
414414
<li class="toctree-l2"><a class="reference internal" href="tutorial/08-Lengthy_benchmarks.html">Time-consuming benchmarks</a></li>
415415
<li class="toctree-l2"><a class="reference internal" href="tutorial/09-Vector_output.html">Vector outputs</a></li>
416416
<li class="toctree-l2"><a class="reference internal" href="tutorial/10-TimeTrains.html">Time Trains</a></li>
417+
<li class="toctree-l2"><a class="reference internal" href="tutorial/11-Manual_benchmarks.html">Running benchmarks manually</a></li>
417418
</ul>
418419
</details></li>
419420
<li class="toctree-l1 has-children"><a class="reference internal" href="benchmarks/index.html">Benchmarks</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
@@ -522,6 +523,9 @@ <h2>Tutorial<a class="headerlink" href="#tutorial" title="Link to this heading">
522523
</div><div class="sphx-glr-thumbcontainer" tooltip="Time Trains"><img alt="" src="../../_images/sphx_glr_10-TimeTrains_thumb.png" />
523524
<p><a class="reference internal" href="tutorial/10-TimeTrains.html#sphx-glr-build-auto-examples-tutorial-10-timetrains-py"><span class="std std-ref">Time Trains</span></a></p>
524525
<div class="sphx-glr-thumbnail-title">Time Trains</div>
526+
</div><div class="sphx-glr-thumbcontainer" tooltip="Running benchmarks manually"><img alt="" src="../../_images/sphx_glr_11-Manual_benchmarks_thumb.png" />
527+
<p><a class="reference internal" href="tutorial/11-Manual_benchmarks.html#sphx-glr-build-auto-examples-tutorial-11-manual-benchmarks-py"><span class="std std-ref">Running benchmarks manually</span></a></p>
528+
<div class="sphx-glr-thumbnail-title">Running benchmarks manually</div>
525529
</div></div></section>
526530
<section id="benchmarks">
527531
<h2>Benchmarks<a class="headerlink" href="#benchmarks" title="Link to this heading">#</a></h2>

docs/gh-pages/_build/auto_examples/tutorial/01-First_benchmark.html

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@
414414
<li class="toctree-l2"><a class="reference internal" href="08-Lengthy_benchmarks.html">Time-consuming benchmarks</a></li>
415415
<li class="toctree-l2"><a class="reference internal" href="09-Vector_output.html">Vector outputs</a></li>
416416
<li class="toctree-l2"><a class="reference internal" href="10-TimeTrains.html">Time Trains</a></li>
417+
<li class="toctree-l2"><a class="reference internal" href="11-Manual_benchmarks.html">Running benchmarks manually</a></li>
417418
</ul>
418419
</details></li>
419420
<li class="toctree-l1 has-children"><a class="reference internal" href="../benchmarks/index.html">Benchmarks</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
@@ -509,29 +510,42 @@
509510
<span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
510511
<span class="n">l</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;&#39;</span><span class="p">)</span>
511512

512-
<a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">all_funs</span></a></a></a></a> <span class="o">=</span> <span class="p">[</span>
513+
<a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">all_funs</span></a> <span class="o">=</span> <span class="p">[</span>
513514
<span class="n">comprehension</span> <span class="p">,</span>
514515
<span class="n">star_operator</span> <span class="p">,</span>
515516
<span class="n">for_loop_append</span> <span class="p">,</span>
516517
<span class="p">]</span>
517518
</pre></div>
518519
</div>
519520
<p>Let’s define relevant sizes of lists to be timed.</p>
520-
<div class="highlight-Python notranslate"><div class="highlight"><pre><span></span><a href="https://docs.python.org/3/library/functions.html#int" title="builtins.int" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/functions.html#int" title="builtins.int" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/functions.html#int" title="builtins.int" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/functions.html#int" title="builtins.int" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">n_bench</span></a></a></a></a> <span class="o">=</span> <span class="mi">12</span>
521-
<a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">all_sizes</span></a></a></a></a> <span class="o">=</span> <span class="p">[</span><span class="mi">2</span><span class="o">**</span><span class="n">n</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><a href="https://docs.python.org/3/library/functions.html#int" title="builtins.int" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/functions.html#int" title="builtins.int" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/functions.html#int" title="builtins.int" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/functions.html#int" title="builtins.int" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">n_bench</span></a></a></a></a><span class="p">)]</span>
521+
<div class="highlight-Python notranslate"><div class="highlight"><pre><span></span><a href="https://docs.python.org/3/library/functions.html#int" title="builtins.int" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">n_bench</span></a> <span class="o">=</span> <span class="mi">12</span>
522+
<a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">all_sizes</span></a> <span class="o">=</span> <span class="p">[</span><span class="mi">2</span><span class="o">**</span><span class="n">n</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><a href="https://docs.python.org/3/library/functions.html#int" title="builtins.int" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">n_bench</span></a><span class="p">)]</span>
522523
</pre></div>
523524
</div>
524525
<p>Now, let’s import pyquickbench, run and plot the benchmark</p>
525526
<div class="highlight-Python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span><span class="w"> </span><span class="nn">pyquickbench</span>
526527

527528
<span class="n">pyquickbench</span><span class="o">.</span><span class="n">run_benchmark</span><span class="p">(</span>
528-
<a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">all_sizes</span></a></a></a></a> <span class="p">,</span>
529-
<a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">all_funs</span></a></a></a></a> <span class="p">,</span>
529+
<a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">all_sizes</span></a> <span class="p">,</span>
530+
<a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">all_funs</span></a> <span class="p">,</span>
530531
<span class="n">show</span> <span class="o">=</span> <span class="kc">True</span> <span class="p">,</span>
531532
<span class="p">)</span>
532533
</pre></div>
533534
</div>
534535
<img src="../../../_images/sphx_glr_01-First_benchmark_001.png" srcset="../../../_images/sphx_glr_01-First_benchmark_001.png" alt="01 First benchmark" class = "sphx-glr-single-img"/><p>From this benchmark, it is easy to see that initializing a list to a given length filled with a single value is quickest using the star operator.</p>
536+
<div class="highlight-Python notranslate"><div class="highlight"><pre><span></span><a href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="numpy.ndarray" class="sphx-glr-backref-module-numpy sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">res</span></a> <span class="o">=</span> <span class="n">pyquickbench</span><span class="o">.</span><span class="n">run_benchmark</span><span class="p">(</span>
537+
<a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">all_sizes</span></a> <span class="p">,</span>
538+
<a href="https://docs.python.org/3/library/stdtypes.html#list" title="builtins.list" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">all_funs</span></a> <span class="p">,</span>
539+
<span class="p">)</span>
540+
541+
<span class="nb">print</span><span class="p">(</span><span class="nb">type</span><span class="p">(</span><a href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="numpy.ndarray" class="sphx-glr-backref-module-numpy sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">res</span></a><span class="p">))</span>
542+
<span class="nb">print</span><span class="p">(</span><a href="https://docs.python.org/3/library/stdtypes.html#tuple" title="builtins.tuple" class="sphx-glr-backref-module-builtins sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">res</span><span class="o">.</span><span class="n">shape</span></a><span class="p">)</span>
543+
</pre></div>
544+
</div>
545+
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;class &#39;numpy.ndarray&#39;&gt;
546+
(12, 3, 1, 1)
547+
</pre></div>
548+
</div>
535549
<div class="sphx-glr-footer sphx-glr-footer-example docutils container" id="sphx-glr-download-build-auto-examples-tutorial-01-first-benchmark-py">
536550
<div class="sphx-glr-download sphx-glr-download-jupyter docutils container">
537551
<p><a class="reference download internal" download="" href="../../../_downloads/a97bdd5149b0f6baa3efc4e0f298d86f/01-First_benchmark.ipynb"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Jupyter</span> <span class="pre">notebook:</span> <span class="pre">01-First_benchmark.ipynb</span></code></a></p>

0 commit comments

Comments
 (0)