Prefetching

Prefetching is the act of retrieving memory into cache lines ahead of time, before the memory is to be accessed. While a prefetch is a slow operation, this doesn't necessarily matter if enough time (unrelated instructions to be executed) exists between the prefetch and the memory access in question. Then, the latency caused by the prefetch will be hidden, and the memory access will be orders of magnitude faster, since the memory is guaranteed to be in the cache upon access.

Prefetching can be done implicitly by the CPU (hardware prefetching) or explicitly by the programmer, by placing prefetch instructions in the code (software prefetching).

Software prefetching is often done heuristically by the compiler. In JRockit it is used, for ...

Get Oracle JRockit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.