PrefetchingPrefetching is a technique used in computing to improve performance by retrieving data or instructions before they are needed. By predicting what a program will request in the future, the system can load information in advance to reduced wait times .[1] Prefetching is used in various areas of computing, including CPU architectures and operating systems. It can be implemented in both hardware and software, and it relies on detecting access patterns that suggest what data is likely to be needed soon. OverviewPrefetching works by predicting which memory addresses or resources will be accessing and load them into faster access storage, like caches.[1] Prefetching may be used:
HardwareProcessors (CPU's) often include prefetching that attempts to reduce cache misses by loading data into cache before it is requested by the running program. This is for programs that access memory in predictable patterns, such as loops that iterate over arrays.[1] Hardware prefetching is can be done without software involvement and can be found in most modern CPU's. For example, Intel CPU's feature a variety of prefetch that work across multiple cache levels.[1]
SoftwarePrefetch instructions can be written into the code by the programmer or by the compiler. Prefetch instructions specify the memory addresses to be prefetched and the desired prefetch distance.[2] In software, there are instructions that can be written with:
Operating systemsOperating systems use prefetching to reduce file and memory access latency.
Web BrowsersWeb browsers apply prefetching techniques to improve perceived performance. Common examples include:
LimitationsPrefetching can significantly improve performance, but it can not always be beneficial if implemented wrong. If predictions are inaccurate, prefetching may waste bandwidth, processing time, or cause cache pollution. In systems with limited resources or highly unpredictable workloads, prefetching can degrade performance rather than improve it.[1] Implementing both software and hardware prefetching can also lead to degraded performance because of interactions that might occur between each other from how it was implemented.[6] See AlsoReferences
|
Portal di Ensiklopedia Dunia