Приглашаем посетить
Есенин (esenin-lit.ru)

Chapter 11.  Computational Reuse

Previous
Table of Contents
Next

11. Computational Reuse

COMPUTATIONAL REUSE IS A TECHNIQUE BY which intermediate data (that is, data that is not the final output of a function) is remembered and used to make other calculations more efficient. Computational reuse has a long history in computer science, particularly in computer graphics and computational mathematics. Don't let these highly technical applications scare you, though; reuse is really just another form of caching.

In the past two chapters we investigated a multitude of caching strategies. At their core, all involve the same premise: You take a piece of data that is expensive to compute and save its value. The next time you need to perform that calculation, you look to see whether you have stored the result already. If so, you return that value.

Computational reuse is a form of caching that focuses on very small pieces of data. Instead of caching entire components of an application, computational reuse focuses on how to cache individual objects or data created in the course of executing a function. Often these small elements can also be reused. Every complex operation is the combined result of many smaller ones. If one particular small operation constitutes a large part of your runtime, optimizing it through caching can give significant payout.


Previous
Table of Contents
Next