Content deleted Content added
Fix link to dab Cache |
m →History: Removed erroneous space and general fixes (task 1) |
||
(29 intermediate revisions by 22 users not shown) | |||
Line 1:
{{short description|Act of performing an initial computation before run time}}
[[Image:Abramowitz&Stegun.page97.agr.jpg|thumb|Part of a 20th
In [[algorithms]], '''precomputation''' is the act of performing an initial [[computation]] before [[Run time (program lifecycle phase)|run time]] to generate a [[lookup table]] that can be used by an algorithm to avoid repeated computation each time it is executed. Precomputation is often used in algorithms that depend on the results of expensive computations that don't depend on the input of the algorithm. A trivial example of precomputation is the use of [[hardcoded]] mathematical constants, such as [[Pi|π]] and [[
In [[database]]s, the term '''materialization''' is used to refer to storing the results of a precomputation,<ref name="HanKamber2011">{{cite book|author1=Jiawei Han|author2=Micheline Kamber|title=Data Mining: Concepts and Techniques: Concepts and Techniques|url=https://books.google.com/books?id=pQws07tdpjoC&pg=PA159|date=9 June 2011|publisher=Elsevier|isbn=978-0-12-381480-7|page=159}}</ref><ref name="Groppe2011">{{cite book|author=Sven Groppe|title=Data Management and Query Processing in Semantic Web Databases|url=https://books.google.com/books?id=HdVZ2MhzP_4C&pg=PA178|date=29 April 2011|publisher=Springer Science & Business Media|isbn=978-3-642-19357-6|page=178}}</ref> such as in a [[materialized view]].<ref name="MortonOsborne2013">{{cite book|author1=Karen Morton|author2=Kerry Osborne|author3=Robyn Sands |author4=Riyaj Shamsudeen |author5=Jared Still|title=Pro Oracle SQL|url=https://books.google.com/books?id=XUPXAQAAQBAJ&pg=PA48|date=28 October 2013|publisher=Apress|isbn=978-1-4302-6220-6|page=48}}</ref><ref name="AufaureZimányi2012">{{cite book|author1=Marie-Aude Aufaure|author2=Esteban Zimányi|title=Business Intelligence: First European Summer School, EBISS 2011, Paris, France, July 3-8, 2011, Tutorial Lectures|url=https://books.google.com/books?id=UWtes499ZaUC&pg=PA43|date=16 January 2012|publisher=Springer Science & Business Media|isbn=978-3-642-27357-5|page=43}}</ref>
== Overview ==
Line 7 ⟶ 10:
== History ==
Before the advent of computers, printed [[lookup table]]s of values were used by people to speed up hand calculations of complex functions, such as in [[trigonometric table]]s, [[Common logarithm|logarithm tables]], and tables of [[statistical density function]]s.<ref>{{cite book
|editor1-last= Campbell-Kelly
|editor1-first= Martin|editor1-link=Martin Campbell-Kelly
|editor2-last= Croarken
|editor2-first= Mary|editor2-link=Mary Croarken
|editor3-last= Flood|editor3-link=Raymond Flood (mathematician)
|editor3-first= Raymond
|display-editors = 3 |editor4-last= Robson|editor4-link=Eleanor Robson
|
|title= The History of Mathematical Tables From Sumer to Spreadsheets
|title-link= The History of Mathematical Tables
▲|origyear= 2003
|publisher= Oxford University Press
|isbn= 978-0-19-850841-0
}}
</ref>
School children are often taught to memorize "[[times table]]s" to avoid calculations of the most commonly used numbers (up to 9 x 9 or 12 x 12). Even as early as 493 A.D., [[Victorius of Aquitaine]] wrote a 98-column multiplication table which gave (in [[Roman numerals]]) the product of every number from 2 to 50 times and the rows were "a list of numbers starting with one thousand, descending by hundreds to one hundred, then descending by tens to ten, then by ones to one, and then the fractions down to 1/144."
== Examples ==
Even modern computer implementations of digital [[trigonometric
Many attacks on [[cryptosystem]]s involve precomputation.
Line 48 ⟶ 41:
[[Compiler]]s use precomputation extensively as a means of increasing the run-time speed of the resulting code: this precomputation can be regarded as in effect a form of [[partial evaluation]] of the program code itself. Examples of this sort of precomputation include [[dataflow analysis]] and [[strength reduction]] steps.
== References ==▼
{{reflist}}▼
== See also ==
Line 56 ⟶ 46:
* [[Algorithmic efficiency]]
* [[Partial evaluation]]
* [[Memoization]]
▲== References ==
[[Category:Software optimization]]▼
▲{{reflist}}
▲[[Category:Software optimization]]
|