Caching Function Results: Faster Arithmetic by Avoiding Unnecessary Computation

  • Authors:
  • Stephen E. Richardson

  • Affiliations:
  • -

  • Venue:
  • Caching Function Results: Faster Arithmetic by Avoiding Unnecessary Computation
  • Year:
  • 1992

Quantified Score

Hi-index 0.01

Visualization

Abstract

This report introduces the notion of trivial computation,where the appearance of simple operands reduces the complexity of apotentially difficult operation. An example of a trivial operationis integer divide-by-two; the division becomes a simple shiftoperation. Also discussed is the concept of redundantcomputation, where some operation repeatedly does the same functionbecause it repeatedly sees the same operands. Using two separatebenchmark suites, the SPEC benchmarks and the Perfect Club, andconcentrating on multiplication, we find a surprising amount oftrivial and redundant operation. Various architectural means ofexploiting this knowledge to improve computational efficiencyinclude detection of trivial operands, memoization,and the result cache.