Search code examples
duplicatesterminologymemoizationredundancy

Terminology - What is the complement of memoization?


If I am correct, memoization is associated with READ operations. What is the term which refers to the same technique used for WRITE operations?

Example:

Let's say an app receives the following inputs,

0 1 2 2 2 2 2 3 4 3 3 3 3 3 4 4 4 2 1 2 5 5 5 5 3

Instead of saving everything, we tune the app to save only the transitions. (i.e ignore consecutive duplicates)

0 1 2 3 4 3 4 2 1 2 5 3

What is the (standard) term that can be used to describe the above technique?

I feel bad about using the same term since the final outcome is quite different. In READ operations, if memoization is used, the final outcome will remain the same. But in above example for WRITE operations, the final output is different from the original input.


Solution

  • "Deduplication of adjacent/most-recent entries". Your example looks like what the uniq tool does.

    If you preserved the count of duplicates, it would be a form of RLE (run-length encoding).

    As an aside, I guess you mean memoization as a way to speed up reads, and this as a method to speed up writes, but I wouldn't say that's the opposite of memoization, since it's opposite of the general goal, but not related to the particular method.