Cache

Cache
> A CPU cache is a cache used by the central processing unit (CPU) of a computer to 
   reduce the average time to access data from the main memory. 
> It can be either a reserved section of main memory or an independent high-speed storage 
   device.
> The cache is a smaller, faster memory which stores copies of the data from frequently used 
    main memory locations.
Two types of caching are commonly used in personal computers:
A) Memory Caching
> A memory cache, sometimes called a cache store or RAM cache, is a portion of memory 
   made of high-speed static RAM (SRAM) instead of the slower and cheaper dynamic RAM 
  (DRAM) used for main memory. 
> Memory caching is effective because most programs access the same data or instructions 
   over and over. By keeping as much of this information as possible in SRAM, the computer 
   avoids accessing the slower DRAM.
> Some memory caches are built into the architecture of microprocessors. The Intel 80486 
   processor, for example, contains an 8K memory cache, and the Pentium has a 16K cache. 
> Such internal caches are often called Level 1 (L1) caches. Most modern PCs also come with 
   external cache memory, called Level 2 (L2) caches. These caches sit between the CPU and 
   the DRAM. Like L1 caches, L2 caches are composed of SRAM but they are much larger.
B) Disk Caching
> Disk caching works under the same principle as memory caching, but instead of using
    high-speed SRAM, a Disk cache uses conventional main memory. 
> The most recently accessed data from the disk (as well as adjacent sectors) is stored in a 
   memory buffer. When a program needs to access data from the disk, it first checks the disk 
   cache to see if the data is there. 
> Disk caching can dramatically improve the performance of applications, because accessing 
   a byte of data in RAM can be thousands of times faster than accessing a byte on a 
   hard disk.
> When data is found in the cache, it is called a cache hit, and the effectiveness of a cache is 
    judged by its hit rate.

Previous
Next Post »