We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Technology

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What Does "Memoization" Mean?

By Alex Newth
Updated: Jan 31, 2024
Views: 5,516
References
Share

Memoization, which is similar to memorization but specific to computers, is a method of optimizing a program’s speed by increasing the amount of space it uses. What this technique directly entails is that a program is built to remember the calculations of a function, and the result is stored in a cache. The next time the function is called, the program can retrieve the calculation from the cache rather than redoing the same calculation. Unlike strength reduction, which speeds up the machine based on a similar speed and space trade-off, memoization is portable and can be used over many machines.

Users may not see it, but programs make calculations all the time. When someone clicks a button on a program or uses an inherent function, a calculation is required to make it work. Often, the user will use the same function several times without any change. Without memoization in place, even though the program just performed a calculation, it would need to do so again. This makes the program’s speed slower than if it stored the result.

The result of a calculation is stored in a cache memory area. With memoization, when the user performs the same or a similar input, the program will draw from the cache rather than perform the calculation to get the answer. By doing this, the program saves time and becomes optimized and faster. The input may be similar and not exactly the same, so some calculations may not be entirely accurate, but the inaccuracy is usually very slight and unlikely to cause errors.

The memoization technique essentially performs a trade-off. All programs are built with size and time constraints. Here, the size is sacrificed so the speed can increase. Results are stored in the cache, so more memory is needed for the program. The amount of memory sacrificed is very slight, because a cache is limited in the amount of results it can store, but it still adds to the space cost.

Another similar, but not as reliable, trade-off optimization technique is strength reduction. Strength reduction does not reduce the strength of the program but the strength of the calculation by breaking it down into weaker, less-memory-costly functions. For example, multiplication requires a larger amount of time to process than addition, so the formula will be changed to allow for the less time-intensive process. This technique is able to speed up processes, but the savings may not be seen on all machines and it only saves compile time.

Share
WiseGeek is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Link to Sources

Editors' Picks

Discussion Comments
Share
https://www.wise-geek.com/what-does-memoization-mean.htm
Copy this link
WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.

WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.