Space-time tradeoff

Space-time tradeoff

In computer science, a space-time or time-memory tradeoff is a situation where the memory use can be reduced at the cost of slower program execution, or vice versa, the computation time can be reduced at the cost of increased memory use. As the relative costs of CPU cycles, RAM space, and hard drive spacechange — hard drive space has for some time been getting cheaper at a much faster rate than other components of computersFact|date=February 2007 — the appropriate choices for space-time tradeoffs have changed radically. Often, by exploiting a space-time tradeoff, a program can be made to run much faster.

The most common situation is an algorithm involving a lookup table: an implementation can include the entire table, which reduces computing time, but increases the amount of memory needed, or it can compute table entries as needed, increasing computing time, but reducing memory requirements.

A space-time tradeoff can be applied to the problem of data storage. If data is stored uncompressed, it takes more space but less time than if the data were stored compressed (since compressing the data reduces the amount of space it takes, but it takes time to run the compression algorithm). Depending on the particular instance of the problem, either way is practical. Another example is displaying mathematical formulae on primarily text-based websites, such as Wikipedia. Storing only the LaTeX source and rendering it as an image every time the page is requested would be trading time for space - more time used, but less space. Rendering the image when the page is changed and storing the rendered images would be trading space for time - more space used, but less time. Note that there are also rare instances where it is possible to directly work with compressed data, such as in the case of compressed bitmap indexes, where it is faster to work with compression than without compression.

Larger code size can be traded for higher program speed when applying loop unwinding. This technique makes the code longer for each iteration of a loop, but saves the computation time required for jumping back to the beginning of the loop at the end of each iteration.

Algorithms that make use of space-time tradeoffs to achieve better running times include the baby-step giant-step algorithm for calculating discrete logarithms.

In the field of cryptography, where the adversary is trying to do better than the exponential time required for a brute force attack, the advantages of a space-time tradeoff can readily be seen. Rainbow tables use partially precomputed values in the hash space of a cryptographic hash function to crack passwords in minutes instead of weeks. Decreasing the size of the rainbow table increases the time required to iterate over the hash space. The meet-in-the-middle attack attack uses a space-time tradeoff to find the cryptographic key in only 2^{n+1} encryptions (and O(2^n) space) versus the expected 2^{2n} encryptions (but only O(1) space) of the naive attack.

Dynamic programming is another example where the time complexity of a problem can be reduced significantly by using more memory.

See also

* Blum's speedup theorem
* Savitch's theorem

External links

* [http://lasecwww.epfl.ch/pub/lasec/doc/Oech03.pdf Philippe Oechslin: Making a Faster Cryptanalytic Time-Memory Trade-Off.]
* [http://www.cs.sjsu.edu/faculty/stamp/RUA/TMTO.pdf Once Upon a Time-Memory Tradeoff.]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Space-time tradeoff — Space time trade off («выбор оптимального соотношения „место время“ (англ. space time trade off)», или, иначе, «выбор оптимального соотношения „время память“» (англ. time memory trade off))  компромиссный подход к решению ряда задач в… …   Википедия

  • Hubble Space Telescope — Infobox Space telescope name = Hubble Space Telescope (HST) caption = The Hubble Space Telescope as seen from Space Shuttle Discovery during its second servicing mission (STS 82) organization = NASAESASTScI alt names = nssdc id =… …   Wikipedia

  • Trade-off — A trade off (or tradeoff) is a situation that involves losing one quality or aspect of something in return for gaining another quality or aspect. It implies a decision to be made with full comprehension of both the upside and downside of a… …   Wikipedia

  • Hash table — Not to be confused with Hash list or Hash tree. Unordered map redirects here. For the proposed C++ class, see unordered map (C++). Hash Table Type unsorted dictionary Invented 1953 Time complexity in big O notation Average Worst case Space …   Wikipedia

  • Meet-in-the-middle attack — Not to be confused with man in the middle attack. The meet in the middle attack is a cryptographic attack which, like the birthday attack, makes use of a space time tradeoff. While the birthday attack attempts to find two values in the domain of… …   Wikipedia

  • Bayesian network — A Bayesian network, Bayes network, belief network or directed acyclic graphical model is a probabilistic graphical model that represents a set of random variables and their conditional dependencies via a directed acyclic graph (DAG). For example …   Wikipedia

  • Baby-step giant-step — In group theory, a branch of mathematics, the baby step giant step algorithm is a series of well defined steps to compute the discrete logarithm. The discrete log problem is of fundamental importance to the area of public key cryptography. Many… …   Wikipedia

  • Data structure alignment — is the way data is arranged and accessed in computer memory. It consists of two separate but related issues: data alignment and data structure padding. When a modern computer reads from or writes to a memory address, it will do this in word sized …   Wikipedia

  • Michael Saks (mathematician) — Michael Ezra Saks is a professor and was (2006–2010) director of the Mathematics Graduate Program at Rutgers University. Saks received his Ph.D from the Massachusetts Institute of Technology in 1980 after completing his dissertation entitled… …   Wikipedia

  • Collatz conjecture — Directed graph showing the orbits of small numbers under the Collatz map. The Collatz conjecture is equivalent to the statement that all paths eventually lead to 1 …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”