{"id":298585,"date":"2021-07-14T13:00:32","date_gmt":"2021-07-14T10:00:32","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/what-is-memoization-and-why-does-it-matter-cloudsavvy-it\/"},"modified":"2021-07-14T13:00:32","modified_gmt":"2021-07-14T10:00:32","slug":"what-is-memoization-and-why-does-it-matter-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/what-is-memoization-and-why-does-it-matter-cloudsavvy-it\/","title":{"rendered":"#What Is Memoization and Why Does It Matter? \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a28dc9175ff1\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a28dc9175ff1\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-memoization-and-why-does-it-matter-cloudsavvy-it\/#A_Simple_Example\" >A Simple Example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-memoization-and-why-does-it-matter-cloudsavvy-it\/#Memoizing_the_Factorial_Function\" >Memoizing the Factorial Function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-memoization-and-why-does-it-matter-cloudsavvy-it\/#A_More_General_Solution\" >A More General Solution<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-memoization-and-why-does-it-matter-cloudsavvy-it\/#When_Not_to_Use_Memoization\" >When Not to Use Memoization?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-memoization-and-why-does-it-matter-cloudsavvy-it\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#What Is Memoization and Why Does It Matter? \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<figure style=\"width: 2896px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage wp-image-12661 size-full\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/69143ce8.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"code on a background\" width=\"2896\" height=\"1516\" src=\"https:\/\/www.shutterstock.com\/image-illustration\/programming-code-abstract-technology-background-software-1467043322\" data-credittext=\"whiteMocca\/Shutterstock.com\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><figcaption class=\"wp-caption-text\"><span class=\"type:primaryImage imagecredit\"><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.shutterstock.com\/image-illustration\/programming-code-abstract-technology-background-software-1467043322\">whiteMocca\/Shutterstock.com<\/a><\/span><\/figcaption><\/figure>\n<p>Memoization is a programming technique that accelerates performance by caching the return values of expensive function calls. A \u201cmemoized\u201d function will im<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/social-mediaa\/\" data-internallinksmanager029f6b8e52c=\"1\" title=\"Social Media\" target=\"_blank\" rel=\"noopener\">media<\/a>tely output a pre-computed value if it\u2019s given inputs that it\u2019s seen before.<\/p>\n<p>Memoization is a specific form of caching that lends itself to scenarios where a costly function is executed repeatedly, sometimes with the same arguments. Provided that the function is pure so that it always produces the same value from a particular set of inputs, memoizing it can increase efficiency and reduce wasted CPU cycles.<\/p>\n<p>You\u2019ll most often encounter memoization in functional programming languages. The technique has broad utility, though. It\u2019s an abstract concept that you can incorporate into any recursive code. We\u2019re using Java<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">Script<\/a> for this article, but you could rewrite the examples into your working language.<\/p>\n<h2 id=\"a-simple-example\"><span class=\"ez-toc-section\" id=\"A_Simple_Example\"><\/span>A Simple Example<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Here\u2019s a simple function that generates the factorial of a given integer:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"javascript\">\n<pre class=\"de1\"><span class=\"kw1\">const<\/span> factorial <span class=\"sy0\">=<\/span> n <span class=\"sy0\">=&gt;<\/span> <span class=\"br0\">{<\/span>\n    <span class=\"kw1\">if<\/span> <span class=\"br0\">(<\/span>n <span class=\"sy0\">===<\/span> <span class=\"nu0\">0<\/span><span class=\"br0\">)<\/span> <span class=\"kw1\">return<\/span> <span class=\"nu0\">1<\/span><span class=\"sy0\">;<\/span>\n    <span class=\"kw1\">else<\/span> <span class=\"kw1\">return<\/span> <span class=\"br0\">(<\/span>factorial<span class=\"br0\">(<\/span>n <span class=\"sy0\">-<\/span> <span class=\"nu0\">1<\/span><span class=\"br0\">)<\/span> <span class=\"sy0\">*<\/span> n<span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n<span class=\"br0\">}<\/span><span class=\"sy0\">;<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>The factorial calculation is recursive, as <code>factorial()<\/code> calls itself within the <code>else<\/code> condition. The calculation is also pure, as any given value of <code>n<\/code> will always return the same value. <code>factorial(5)<\/code> is <code>120<\/code>, irrespective of the state of the program.<\/p>\n<p>Because of the recursive nature of the function, computing the factorial of several large numbers incurs wasted operations:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"javascript\">\n<pre class=\"de1\"><span class=\"kw1\">const<\/span> x <span class=\"sy0\">=<\/span> factorial<span class=\"br0\">(<\/span><span class=\"nu0\">100<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw1\">const<\/span> y <span class=\"sy0\">=<\/span> factorial<span class=\"br0\">(<\/span><span class=\"nu0\">50<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>All the calculations needed to compute <code>y<\/code> were <em>already performed<\/em> as part of the computation of <code>x<\/code>. If <code>factorial()<\/code> were to cache its inputs and their corresponding outputs, the calculation of <code>y<\/code> could be significantly sped up.<\/p>\n<h2 id=\"memoizing-the-factorial-function\"><span class=\"ez-toc-section\" id=\"Memoizing_the_Factorial_Function\"><\/span>Memoizing the Factorial Function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Here\u2019s a basic approach that memoizes the <code>factorial()<\/code> function:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"javascript\">\n<pre class=\"de1\"><span class=\"kw1\">const<\/span> cache <span class=\"sy0\">=<\/span> <span class=\"br0\">{<\/span><span class=\"br0\">}<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n<span class=\"kw1\">const<\/span> factorial <span class=\"sy0\">=<\/span> n <span class=\"sy0\">=&gt;<\/span> <span class=\"br0\">{<\/span>\n\u00a0\n    <span class=\"kw1\">if<\/span> <span class=\"br0\">(<\/span>cache<span class=\"br0\">[<\/span>n<span class=\"br0\">]<\/span><span class=\"br0\">)<\/span> <span class=\"br0\">{<\/span>\n        <span class=\"kw1\">return<\/span> cache<span class=\"br0\">[<\/span>n<span class=\"br0\">]<\/span><span class=\"sy0\">;<\/span>\n    <span class=\"br0\">}<\/span>\n\u00a0\n    let value<span class=\"sy0\">;<\/span>\n    <span class=\"kw1\">if<\/span> <span class=\"br0\">(<\/span>n <span class=\"sy0\">===<\/span> <span class=\"nu0\">0<\/span><span class=\"br0\">)<\/span> value <span class=\"sy0\">=<\/span> <span class=\"nu0\">1<\/span><span class=\"sy0\">;<\/span>\n    <span class=\"kw1\">else<\/span> value <span class=\"sy0\">=<\/span> <span class=\"br0\">(<\/span>factorial<span class=\"br0\">(<\/span>n <span class=\"sy0\">-<\/span> <span class=\"nu0\">1<\/span><span class=\"br0\">)<\/span> <span class=\"sy0\">*<\/span> n<span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n    cache<span class=\"br0\">[<\/span>n<span class=\"br0\">]<\/span> <span class=\"sy0\">=<\/span> value<span class=\"sy0\">;<\/span>\n    <span class=\"kw1\">return<\/span> value<span class=\"sy0\">;<\/span>\n\u00a0\n<span class=\"br0\">}<\/span><span class=\"sy0\">;<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Now, there\u2019s a <code>cache<\/code> object that <code>factorial()<\/code> uses to record its output values. Each time the function is called, it first checks whether it\u2019s previously seen the input <code>n<\/code>. If it has, it can short circuit immediately and return the cached value. Otherwise, the recursive calculation proceeds as normal, but subsequent runs using the same number will be sped up.<\/p>\n<p>Now, computing <code>factorial(50)<\/code> after <code>factorial(100)<\/code> will be vastly more efficient. The factorial of <code>50<\/code> would be calculated as part of the factorial of <code>100<\/code>, so the function could return the value almost instantaneously.<\/p>\n<h2 id=\"a-more-general-solution\"><span class=\"ez-toc-section\" id=\"A_More_General_Solution\"><\/span>A More General Solution<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>While the above code works, it\u2019s specific to the <code>factorial()<\/code> function. If you were using other similar functions, you\u2019d need to manually add the caching code to each one.<\/p>\n<p>A more <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/general\/\" data-internallinksmanager029f6b8e52c=\"3\" title=\"General\" target=\"_blank\" rel=\"noopener\">general<\/a> solution would let you wrap any function with a higher-order function that provides the memoizing capability:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"javascript\">\n<pre class=\"de1\"><span class=\"kw1\">const<\/span> memoize <span class=\"sy0\">=<\/span> fn <span class=\"sy0\">=&gt;<\/span> <span class=\"br0\">{<\/span>\n\u00a0\n    <span class=\"kw1\">const<\/span> cache <span class=\"sy0\">=<\/span> <span class=\"br0\">{<\/span><span class=\"br0\">}<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n    <span class=\"kw1\">return<\/span> <span class=\"br0\">(<\/span>...<span class=\"me1\">args<\/span><span class=\"br0\">)<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"br0\">{<\/span>\n        <span class=\"kw1\">const<\/span> argsString <span class=\"sy0\">=<\/span> JSON.<span class=\"me1\">stringify<\/span><span class=\"br0\">(<\/span>args<span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n        <span class=\"kw1\">if<\/span> <span class=\"br0\">(<\/span><span class=\"sy0\">!<\/span>cache<span class=\"br0\">[<\/span>argsString<span class=\"br0\">]<\/span><span class=\"br0\">)<\/span> <span class=\"br0\">{<\/span>\n            cache<span class=\"br0\">[<\/span>argsString<span class=\"br0\">]<\/span> <span class=\"sy0\">=<\/span> fn<span class=\"br0\">(<\/span>...<span class=\"me1\">args<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n        <span class=\"br0\">}<\/span>\n        <span class=\"kw1\">return<\/span> cache<span class=\"br0\">[<\/span>argsString<span class=\"br0\">]<\/span><span class=\"sy0\">;<\/span>\n    <span class=\"br0\">}<\/span>\n\u00a0\n<span class=\"br0\">}<\/span><span class=\"sy0\">;<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Now, you can adjust the original <code>factorial()<\/code> function:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"javascript\">\n<pre class=\"de1\"><span class=\"kw1\">const<\/span> factorial <span class=\"sy0\">=<\/span> memoize<span class=\"br0\">(<\/span>n <span class=\"sy0\">=&gt;<\/span> <span class=\"br0\">{<\/span>\n    <span class=\"kw1\">if<\/span> <span class=\"br0\">(<\/span>n <span class=\"sy0\">===<\/span> <span class=\"nu0\">0<\/span><span class=\"br0\">)<\/span> <span class=\"kw1\">return<\/span> <span class=\"nu0\">1<\/span><span class=\"sy0\">;<\/span>\n    <span class=\"kw1\">else<\/span> <span class=\"kw1\">return<\/span> <span class=\"br0\">(<\/span>factorial<span class=\"br0\">(<\/span>n <span class=\"sy0\">-<\/span> <span class=\"nu0\">1<\/span><span class=\"br0\">)<\/span> <span class=\"sy0\">*<\/span> n<span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n<span class=\"br0\">}<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>By wrapping <code>factorial()<\/code> with <code>memoize()<\/code>, it gains automatic memoization capabilities. The wrapper function returns a <em>new<\/em> function that intercepts all calls to <code>factorial()<\/code>, stringifies their arguments, and checks whether they\u2019ve been seen before. If they have, the previous return value is reused without calling the real function at all. When new arguments are seen, the function gets invoked, and its output is added to the cache.<\/p>\n<p>The wrapper uses <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Functions\/rest_parameters\">the JavaScript rest parameters syntax<\/a> to accept a variadic number of arguments. This means that it will work with any JavaScript function. This approach is using <code>JSON.stringify()<\/code> to create the string representation of the arguments, so care should be taken if you\u2019re calling a function with complex objects, which can\u2019t be fully represented as JSON.<\/p>\n<h2 id=\"when-not-to-use-memoization\"><span class=\"ez-toc-section\" id=\"When_Not_to_Use_Memoization\"><\/span>When Not to Use Memoization?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Memoization can deliver significant performance improvements, particularly to mathematically heavy operations. It isn\u2019t a technique to use everywhere, though. Not all functions should be memoized, as you could end up harming performance in some cases.<\/p>\n<p>By wrapping a function with <code>memoize()<\/code>, you\u2019re forcing a comparison of the input arguments each time that function is called. This in itself will consume some CPU time. The example wrapper above runs <code>JSON.stringify()<\/code> every time that the function is called, adding a new overhead.<\/p>\n<p>Memoization is appropriate for functions where there\u2019s a high chance that the same input values will be seen regularly. If you\u2019ll rarely call a function with the same arguments, cache hits will be infrequent, and you might lose performance to argument serialization and comparison. Maintaining the cache also increases memory use, as all previous inputs and outputs need to be retained.<\/p>\n<p>You should, therefore, fully assess each function\u2019s role in your program before deciding to memoize. Compare performance with and without memoization. Sometimes, it can prove more beneficial to rely on the browser\u2019s own optimizations.<\/p>\n<p>Finally, bear in mind that some functions <em>can\u2019t<\/em> be memoized. The technique only works with pure functions\u2014if your function reaches out to global variables or some other application state, it should not be memoized!<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"javascript\">\n<pre class=\"de1\"><span class=\"kw1\">const<\/span> functionUsingGlobalState <span class=\"sy0\">=<\/span> n <span class=\"sy0\">=&gt;<\/span> <span class=\"br0\">{<\/span>\n    <span class=\"kw1\">if<\/span> <span class=\"br0\">(<\/span>n <span class=\"sy0\">===<\/span> window.<span class=\"me1\">scrollY<\/span><span class=\"br0\">)<\/span> <span class=\"kw1\">return<\/span> <span class=\"kw2\">true<\/span><span class=\"sy0\">;<\/span>\n    <span class=\"kw1\">else<\/span> <span class=\"kw1\">return<\/span> functionUsingGlobalState<span class=\"br0\">(<\/span>n <span class=\"sy0\">-<\/span> <span class=\"nu0\">1<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n<span class=\"br0\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Memoizing the function above could yield unexpected results after the first run. Values of <code>n<\/code> will be cached using the original <code>window.scrollY<\/code> version. The memoization wrapper will return the cached output, even if <code>window.scrollY<\/code> has changed.<\/p>\n<h2 id=\"summary\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Memoization is a form of caching that accelerates the performance of repetitive recursive operations. It\u2019s a functional programming technique that can be implemented as a generic wrapper for any pure function.<\/p>\n<p>You\u2019ll most often encounter memoization in frequently called functions that perform computationally heavy operations. It helps avoid waste by removing the need to recalculate values that have already been produced as part of a previous call.<\/p>\n<p>The benefits of memoization will be less apparent in functions that are simple to begin with or infrequently called. In some cases, improper use of memoization can actually harm performance, so don\u2019t blindly memoize every function in your application.\n<\/p><\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/12446\/what-is-memoization-and-why-does-it-matter\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#What Is Memoization and Why Does It Matter? \u2013 CloudSavvy IT&#8221; whiteMocca\/Shutterstock.com Memoization is a programming technique that accelerates performance by caching the return values of expensive function calls. A \u201cmemoized\u201d function will immediately output a pre-computed value if it\u2019s given inputs that it\u2019s seen before. Memoization is a specific form of caching that lends&#8230;<\/p>\n","protected":false},"author":1,"featured_media":298586,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/07\/69143ce8.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-298585","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/298585","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=298585"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/298585\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/298586"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=298585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=298585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=298585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}