<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>benchmarking on ankit bahuguna</title>
    <link>https://ankitbahuguna.xyz/tags/benchmarking/</link>
    <description>Recent content in benchmarking on ankit bahuguna</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Thu, 24 Aug 2023 18:48:12 +0530</lastBuildDate>
    <atom:link href="https://ankitbahuguna.xyz/tags/benchmarking/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Tail recursion - Part 2</title>
      <link>https://ankitbahuguna.xyz/posts/benchmarking-recursive-and-tail-recursive-functions-in-ocaml/</link>
      <pubDate>Thu, 24 Aug 2023 18:48:12 +0530</pubDate>
      <guid>https://ankitbahuguna.xyz/posts/benchmarking-recursive-and-tail-recursive-functions-in-ocaml/</guid>
      <description>This post is a continuation of the my last post . I did some benchmarking for recursive and non-recursive version of sum function.
open Unix (* Tail recursive version *) let min_list_tail lst = let rec min_tail lst acc = match lst with | [] -&amp;gt; acc | h :: t -&amp;gt; min_tail t (if h &amp;lt; acc then h else acc) in match lst with | [] -&amp;gt; failwith &amp;#34;Empty list&amp;#34; | h :: t -&amp;gt; min_tail t h (* Non-tail recursive version *) let rec min_list_non_tail = function | [] -&amp;gt; failwith &amp;#34;Empty list&amp;#34; | [x] -&amp;gt; x | h :: t -&amp;gt; let min_tail = min_list_non_tail t in if h &amp;lt; min_tail then h else min_tail let generate_large_list size = List.</description>
    </item>
  </channel>
</rss>
