3 ms·
Pointer chasing is expensive because fetching a random location defeats locality and therefore caches the the CPU's stream detection. But a compacting GC copie
by garethrowlands 4y ago
Pointer chasing is expensive because fetching a random location defeats locality and therefore caches the the CPU's stream detection.
But a compacting GC copies the data it's scanned into a contiguous stream, dramatically improving locality, cache utility and stream detection. And this affects not only subsequent GCs but also the application itself, which may traverse its object graph far more often than the GC does.