Lookup table

Written By: Ehsan Jahandarpour

In computer science, a lookup table (LUT) is an array that replaces runtime computation with a simpler array indexing operation. The process is termed as “direct addressing” and LUTs differ from hash tables in a way that, to retrieve a value with key , a hash table would store the value in the slot where is a hash function i.e. is used to compute the slot, while in the case of LUT, the value is stored in slot , thus directly addressable. The savings in processing time can be significant, because retrieving a value from memory is often faster than carrying out an “expensive” computation or input/output operation. The tables may be precalculated and stored in static program storage, calculated (or “pre-fetched”) as part of a program’s initialization phase (memoization), or even stored