FrontPage

Cache (キャッシュ)

Definition

In computing, a cache is a hardware or software component that stores data so that future requests for that data can be served faster.

The data stored in a cache might be :

  • the result of an earlier computation
  • a copy of data stored elsewhere.

Introduction

What will happen when we request for a data?

Cache.png

Request data -> search cache

  • -> data found -> return data (cache hit)
  • -> data not found -> ask other storage (cache miss)

Memory hierarchy (記憶階層)

hei.png
600px-Memory_hierarchy.svg.png

理想は大容量×高速アクセス(コスパに悪い)

現実は小容量×高速、中容量×中速、大容量×低速など複数段階にまたがった記憶構造

Caches are relatively small in order to be cost-effective and to enable efficient use of data.

  • large -> more expansive
  • large -> physical distance increases -> slower access speed

The more requests that can be served from the cache, the faster the system performs

Locality of reference (局所性)

The tendency of processor to access the same set of memory locations.

  • temporal locality (時間的局所性)
    • reuse of specific data within a relatively small time duration
  • spatial locality (空間的局所性)
    • use of data within relatively close storage locations

Calculate data access time

hit rate (H)
the rate of cache hit (0 ~ 100 %)
latency (T)
memory access time (unit : clock cycles / nanosecond)
   T(average access) = H * T (Cache) + (1 - H) * T (memory)

Types of cache

Hardware

  • CPU cache
    • what this wiki page is mainly focused about
  • GPU cache

Software

  • Web cache
    • save resources like picture to reduces bandwidth and processing requirements of the web server
  • Disk cache
  • Memoization
    • an optimization technique, related to the dynamic programming algorithm
  • DNS (Domain Name System)
    • mapping of domain names to IP addresses

Terms

Cache
a hardware or software component that stores data for faster future requests
Cache hit
when requested data can be found
Cache miss
when requested data cannot be found
Locality of reference
the tendency of a processor to access the same set of memory locations
temporal locality
reuse of specific data within a relatively small time duration
spatial locality
use of data within relatively close storage locations

References

FrontPage


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2019-07-04 (木) 10:52:35 (878d)