Prefetching 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.
- Stride prefetching detects constant-stride memory access patterns (fixed distance between consecutive memory accesses)
- Stream prefetching identifies long sequences of contiguous memory accesses (sequential access to a block of memory)
- Link prefetching: loads linked web pages or assets before the user clicks them
- Resource preloading: fetches critical resources (like fonts or scripts) in parallel with the current page load
Limitations
Prefetching 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.
See also
- Cache (computing)
- Cache prefetching
- Instruction prefetch
- Speculative execution
- Prefetch input queue
