Skip to content

Commit

Permalink
deploy: be88400
Browse files Browse the repository at this point in the history
  • Loading branch information
umcconnell committed May 1, 2024
1 parent 4427aad commit 3a8e7b4
Show file tree
Hide file tree
Showing 21 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion 404.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion about/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
oEJFKo7VOZadqiYdLOQBd/dveXVsO7gJQl5KCg9wbRUzgxnkGsyfdHPDxS0jnBk=
=94sS
-----END PGP PUBLIC KEY BLOCK-----
</code></pre><h2>Blog</h2><p>This blog is built with open-source software components. Here are some of the main ones used in this blog:</p><ul class="u-mt1"><li><strong>Static site generator</strong>: <a href="https://11ty.dev" target="_blank">11ty</a></li><li><strong>11ty base template</strong>: <a href="https://github.com/maxboeck/eleventastic" target="_blank">eleventastic</a></li><li><strong>Templating language</strong>: <a href="https://mozilla.github.io/nunjucks/" target="_blank">Nunjucks</a></li><li><strong>Markdown</strong>: <a href="https://github.com/markdown-it/markdown-it" target="_blank">markdown-it</a></li><li><strong>Code Highlighting</strong>: <a href="https://prismjs.com/" target="_blank">Prism.js</a></li><li><strong>Math</strong>: <a href="https://katex.org/" target="_blank">KaTeX</a></li><li><strong>Icons</strong>: <a href="https://primer.style/octicons/" target="_blank">Primer Icons</a></li><li><strong>Comment System</strong>: <a href="https://utteranc.es/" target="_blank">utterances</a></li></ul></div></main><footer class="footer" role="contentinfo"><div class="footer__inner container"><div class="footer__left">&copy; Copyright 2024 Ulysse McConnell<p>Code: <a rel="license noopener noreferrer" href="https://github.com/umcconnell/umcconnell.github.io/blob/main/LICENSE" target="_blank">MIT License</a>, Content: <a rel="license noopener noreferrer" href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank"><img alt="Creative Commons License" src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png" style="border-width:0" width="80" height="15"></a></p><p>Built with <a rel="noopener noreferrer" href="https://11ty.dev" target="_blank">11ty</a>, using the <a rel="noopener noreferrer" href="https://github.com/maxboeck/eleventastic" target="_blank">eleventastic</a> template.</p><p>Commit #<a rel="noopener noreferrer" href="https://github.com/umcconnell/umcconnell.github.io/commit/0fdc7a29a5a8eac459cf4bc25f87c2ee2af98521" target="_blank">0fdc7a2</a> (<a href="/build.txt">Build info</a>)</p></div><div class="footer__right"><a href="https://github.com/umcconnell/"><svg class="icon icon--github" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-github"></use></svg></a><a href="/feed.xml"><svg class="icon icon--rss" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-rss"></use></svg></a></div></div></footer></div><script type="text/javascript" src="/assets/scripts/main.js"></script></body></html>
</code></pre><h2>Blog</h2><p>This blog is built with open-source software components. Here are some of the main ones used in this blog:</p><ul class="u-mt1"><li><strong>Static site generator</strong>: <a href="https://11ty.dev" target="_blank">11ty</a></li><li><strong>11ty base template</strong>: <a href="https://github.com/maxboeck/eleventastic" target="_blank">eleventastic</a></li><li><strong>Templating language</strong>: <a href="https://mozilla.github.io/nunjucks/" target="_blank">Nunjucks</a></li><li><strong>Markdown</strong>: <a href="https://github.com/markdown-it/markdown-it" target="_blank">markdown-it</a></li><li><strong>Code Highlighting</strong>: <a href="https://prismjs.com/" target="_blank">Prism.js</a></li><li><strong>Math</strong>: <a href="https://katex.org/" target="_blank">KaTeX</a></li><li><strong>Icons</strong>: <a href="https://primer.style/octicons/" target="_blank">Primer Icons</a></li><li><strong>Comment System</strong>: <a href="https://utteranc.es/" target="_blank">utterances</a></li></ul></div></main><footer class="footer" role="contentinfo"><div class="footer__inner container"><div class="footer__left">&copy; Copyright 2024 Ulysse McConnell<p>Code: <a rel="license noopener noreferrer" href="https://github.com/umcconnell/umcconnell.github.io/blob/main/LICENSE" target="_blank">MIT License</a>, Content: <a rel="license noopener noreferrer" href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank"><img alt="Creative Commons License" src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png" style="border-width:0" width="80" height="15"></a></p><p>Built with <a rel="noopener noreferrer" href="https://11ty.dev" target="_blank">11ty</a>, using the <a rel="noopener noreferrer" href="https://github.com/maxboeck/eleventastic" target="_blank">eleventastic</a> template.</p><p>Commit #<a rel="noopener noreferrer" href="https://github.com/umcconnell/umcconnell.github.io/commit/be884006638e172274ee0e111d480569868ab0b5" target="_blank">be88400</a> (<a href="/build.txt">Build info</a>)</p></div><div class="footer__right"><a href="https://github.com/umcconnell/"><svg class="icon icon--github" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-github"></use></svg></a><a href="/feed.xml"><svg class="icon icon--rss" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-rss"></use></svg></a></div></div></footer></div><script type="text/javascript" src="/assets/scripts/main.js"></script></body></html>
4 changes: 2 additions & 2 deletions build.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
LAST BUILD: 2024-05-01T18:55:12.491
COMMIT: 0fdc7a29a5a8eac459cf4bc25f87c2ee2af98521
LAST BUILD: 2024-05-01T18:55:16.695
COMMIT: be884006638e172274ee0e111d480569868ab0b5
ENV: production
2 changes: 1 addition & 1 deletion index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion posts/2021-03-11-hello-internet/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion posts/2021-03-13-fibonacci-rust/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@
<span class="token punctuation">}</span>

<span class="token macro property">criterion_group!</span><span class="token punctuation">(</span>benches<span class="token punctuation">,</span> bench_fibs<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token macro property">criterion_main!</span><span class="token punctuation">(</span>benches<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre><p>This code creates a test group called <code>Fibonacci</code> and benchmarks the four different approaches using the same input. Run the benchmark in your terminal:</p><pre class="language-bash"><code class="language-bash"><span class="token function">cargo</span> bench</code></pre><p>Once the benchmarks are done, you can view a nice HTML report in your browser by opening <code>target/criterion/Fibonacci/report/index.html</code>. Running on my machine gave me the following stats:</p><p><img src="/assets/images/posts/fibonacci-rust/perf_plot.svg" alt="Performance plot of the different methods"></p><p>You can clearly see, that the naive recursive solution is the least performant approach, as its execution time increases (exponentially, but not visible with 2 inputs) with the workload. The memoized version, in contrast, shows a great improvement, but it still incurs the performance overhead of initializing and managing the memo, making it less performant than the two last approaches.</p><p>The iterator and standard seem to be indistinguishable. On my machine, the execution of the iterator takes <code>~34ns</code> for both inputs, the standard approach around <code>~4.5ns</code> for both inputs.</p><p>You can find more detailed graphs and charts for every function in the corresponding <code>target/criterion/Fibonacci/&lt;APPROACH&gt;/report/index.html</code> folder.</p><h2 id="conclusion" tabindex="-1">Conclusion<a href="#conclusion" class="anchor-link"><svg class="icon icon--link" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-link"></use></svg></a></h2><p>We’ve implemented and benchmarked four different approaches to generating the Fibonacci sequence.</p><p>Although the recursive solution is short and concise, it is by far the least performant and can become too slow to calculate for larger inputs. The memoized solution is interesting, in that it combines the conciseness of the recursive approach with a greater speed. The standard approach, on the other hand, seems to be the fastest, but it is arguably the least elegant.</p><p>Finally, the iterator solution appears to be by far the most versatile while at the same time being very fast. Additionally, it allows the user to work with the sequence in a very convenient way, e.g. by filtering, mapping, etc.</p><p>Overall, it becomes clear that iterators are a very versatile and performant aspect of Rust, that are also worth considering in other languages such as Python or JavaScript.</p><p>The final code of this project is open source and available here: <a href="https://github.com/umcconnell/rust_fibonacci" target="_blank" rel="noopener noreferrer">https://github.com/umcconnell/rust_fibonacci<svg class="icon icon--link-external" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-link-external"></use></svg></a></p><p>Feedback, questions, comments or improvements are welcome!</p><p>Thanks for reading.</p></div><footer class="post__footer"><div class="links"><a href="/posts/" class="back"><svg class="icon icon--arrow-left" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-arrow-left"></use></svg>Back to Posts</a> <a href="https://github.com/umcconnell/umcconnell.github.io/blob/main/./src/posts/2021-03-13-fibonacci-rust.md" class="edit" target="_blank"><svg class="icon icon--pencil" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-pencil"></use></svg>Edit on Github</a></div><div class="post__comments"><h2>Comments</h2><script src="https://utteranc.es/client.js" repo="umcconnell/comments" issue-term="pathname" label="comment" theme="preferred-color-scheme" crossorigin="anonymous" async></script></div></footer></article></main><footer class="footer" role="contentinfo"><div class="footer__inner container"><div class="footer__left">&copy; Copyright 2024 Ulysse McConnell<p>Code: <a rel="license noopener noreferrer" href="https://github.com/umcconnell/umcconnell.github.io/blob/main/LICENSE" target="_blank">MIT License</a>, Content: <a rel="license noopener noreferrer" href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank"><img alt="Creative Commons License" src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png" style="border-width:0" width="80" height="15"></a></p><p>Built with <a rel="noopener noreferrer" href="https://11ty.dev" target="_blank">11ty</a>, using the <a rel="noopener noreferrer" href="https://github.com/maxboeck/eleventastic" target="_blank">eleventastic</a> template.</p><p>Commit #<a rel="noopener noreferrer" href="https://github.com/umcconnell/umcconnell.github.io/commit/0fdc7a29a5a8eac459cf4bc25f87c2ee2af98521" target="_blank">0fdc7a2</a> (<a href="/build.txt">Build info</a>)</p></div><div class="footer__right"><a href="https://github.com/umcconnell/"><svg class="icon icon--github" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-github"></use></svg></a><a href="/feed.xml"><svg class="icon icon--rss" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-rss"></use></svg></a></div></div></footer></div><script type="text/javascript" src="/assets/scripts/main.js"></script></body></html>
<span class="token macro property">criterion_main!</span><span class="token punctuation">(</span>benches<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre><p>This code creates a test group called <code>Fibonacci</code> and benchmarks the four different approaches using the same input. Run the benchmark in your terminal:</p><pre class="language-bash"><code class="language-bash"><span class="token function">cargo</span> bench</code></pre><p>Once the benchmarks are done, you can view a nice HTML report in your browser by opening <code>target/criterion/Fibonacci/report/index.html</code>. Running on my machine gave me the following stats:</p><p><img src="/assets/images/posts/fibonacci-rust/perf_plot.svg" alt="Performance plot of the different methods"></p><p>You can clearly see, that the naive recursive solution is the least performant approach, as its execution time increases (exponentially, but not visible with 2 inputs) with the workload. The memoized version, in contrast, shows a great improvement, but it still incurs the performance overhead of initializing and managing the memo, making it less performant than the two last approaches.</p><p>The iterator and standard seem to be indistinguishable. On my machine, the execution of the iterator takes <code>~34ns</code> for both inputs, the standard approach around <code>~4.5ns</code> for both inputs.</p><p>You can find more detailed graphs and charts for every function in the corresponding <code>target/criterion/Fibonacci/&lt;APPROACH&gt;/report/index.html</code> folder.</p><h2 id="conclusion" tabindex="-1">Conclusion<a href="#conclusion" class="anchor-link"><svg class="icon icon--link" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-link"></use></svg></a></h2><p>We’ve implemented and benchmarked four different approaches to generating the Fibonacci sequence.</p><p>Although the recursive solution is short and concise, it is by far the least performant and can become too slow to calculate for larger inputs. The memoized solution is interesting, in that it combines the conciseness of the recursive approach with a greater speed. The standard approach, on the other hand, seems to be the fastest, but it is arguably the least elegant.</p><p>Finally, the iterator solution appears to be by far the most versatile while at the same time being very fast. Additionally, it allows the user to work with the sequence in a very convenient way, e.g. by filtering, mapping, etc.</p><p>Overall, it becomes clear that iterators are a very versatile and performant aspect of Rust, that are also worth considering in other languages such as Python or JavaScript.</p><p>The final code of this project is open source and available here: <a href="https://github.com/umcconnell/rust_fibonacci" target="_blank" rel="noopener noreferrer">https://github.com/umcconnell/rust_fibonacci<svg class="icon icon--link-external" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-link-external"></use></svg></a></p><p>Feedback, questions, comments or improvements are welcome!</p><p>Thanks for reading.</p></div><footer class="post__footer"><div class="links"><a href="/posts/" class="back"><svg class="icon icon--arrow-left" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-arrow-left"></use></svg>Back to Posts</a> <a href="https://github.com/umcconnell/umcconnell.github.io/blob/main/./src/posts/2021-03-13-fibonacci-rust.md" class="edit" target="_blank"><svg class="icon icon--pencil" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-pencil"></use></svg>Edit on Github</a></div><div class="post__comments"><h2>Comments</h2><script src="https://utteranc.es/client.js" repo="umcconnell/comments" issue-term="pathname" label="comment" theme="preferred-color-scheme" crossorigin="anonymous" async></script></div></footer></article></main><footer class="footer" role="contentinfo"><div class="footer__inner container"><div class="footer__left">&copy; Copyright 2024 Ulysse McConnell<p>Code: <a rel="license noopener noreferrer" href="https://github.com/umcconnell/umcconnell.github.io/blob/main/LICENSE" target="_blank">MIT License</a>, Content: <a rel="license noopener noreferrer" href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank"><img alt="Creative Commons License" src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png" style="border-width:0" width="80" height="15"></a></p><p>Built with <a rel="noopener noreferrer" href="https://11ty.dev" target="_blank">11ty</a>, using the <a rel="noopener noreferrer" href="https://github.com/maxboeck/eleventastic" target="_blank">eleventastic</a> template.</p><p>Commit #<a rel="noopener noreferrer" href="https://github.com/umcconnell/umcconnell.github.io/commit/be884006638e172274ee0e111d480569868ab0b5" target="_blank">be88400</a> (<a href="/build.txt">Build info</a>)</p></div><div class="footer__right"><a href="https://github.com/umcconnell/"><svg class="icon icon--github" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-github"></use></svg></a><a href="/feed.xml"><svg class="icon icon--rss" role="img" aria-hidden="true" width="24" height="24"><use xlink:href="#icon-rss"></use></svg></a></div></div></footer></div><script type="text/javascript" src="/assets/scripts/main.js"></script></body></html>

0 comments on commit 3a8e7b4

Please sign in to comment.