What’s the meaning of “memorization”?

Print anything with Printful



Caching is a technique used to optimize program speed by storing the results of calculations in a cache memory area. Memoization sacrifices program size for speed, while force reduction breaks computations into weaker functions.

Caching, which is similar to caching but specific to computers, is a method of optimizing the speed of a program 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 fetch the calculation from the cache instead of repeating the same calculation. Unlike force reduction, which accelerates the machine based on a similar speed and space trade-off, memoization is portable and can be used on many machines.

Users may not see it, but programs are calculating all the time. When someone clicks a button on a program or uses an intrinsic function, some computation is required to make it work. Often the user will use the same function multiple times without any changes. Without storing in place, even if the program just did a calculation, it would have to do it again. This makes the program speed slower than if it stored the result.

The result of a calculation is stored in a cache memory area. With caching, when the user does the same or similar input, the program will draw from the cache instead of doing the computation to get the response. This way, 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 memorization technique essentially performs a trade-off. All programs are built with size and time constraints. Here, size is sacrificed so that speed can increase. The results are cached, so more memory is needed for the program. The amount of memory sacrificed is very small, because a cache is limited in the amount of results it can store, but still increases the cost of space.

Another similar, but not as reliable trade-off optimization technique is force reduction. Strength reduction does not reduce the strength of the program but the strength of the computation by breaking it into weaker and less memory-expensive functions. For example, multiplication takes more time to process than addition, so the formula will be modified to allow for the less time-consuming process. This technique can speed up processes, but the savings may not be visible on all machines and only saves compile time.




Protect your devices with Threat Protection by NordVPN


Skip to content