Impenetrable Thoughts
Classic Computing Trade Offs

These trade offs keep coming up. Knowing about them in advance can lead to better designs.

This page is currently a work in progress. Suggestions welcomed.

Memory versus Time

Imagine that you have a complex calculation which you need to perform frequently over a limited set of input. Say you have to compute the values of sine. You can go about this two ways. The first is to redo the computation every time. The second is to construct a table with the results once and then index into this table whenever you would otherwise perform the computation.

In deciding whether a computation or a lookup it the better way to go one must look at not only the amount of memory available, but also how long it takes to access that memory. A lookup which takes 1000 cycles is not worthwhile if the computation only requires 200 cycles. The relative performance of CPUs compared against L2 caches and main memory accesses has tended to make computation cheaper than lookups in most cases.

Upcoming Entries

  • Delay vs resource consumption (eg. push email versus pull email)

  • Build vs Buy (eg. Pay for versus have to maintain)