Master the fundamental concepts of memory hierarchy through this focused micro-challenge.
Every virtual address lookup can walk page tables (four levels on x86-64). The TLB caches recent virtual-to-physical mappings. TLB misses trigger expensive page walks handled by the MMU.
cLoading…
A 4 KiB page and a 64-entry TLB cover only 256 KiB without misses. Jumping across thousands of pages intentionally blows the TLB.
For this exercise, you will benchmark pointer chasing across increasing page counts. This task asks you to correlate miss spikes with page-table walk cost, the same knob hugetlbfs and JVM -XX:+UseLargePages adjust in production.
Keep the relevant datasheet, ISA manual, or architecture textbook chapter open while you implement. When your output disagrees with the reference trace on the same program, the bug is usually a mis-decoded opcode, a stale register read, or a flag bit left unchanged after arithmetic.
For this exercise, you will use those habits while implementing the requirement in the starter code. Microarchitectural product names change across CPU generations, but the control ideas (fetch, bypass, cache lines, vector lanes) stay stable enough to debug from first principles.
Benchmark TLB performance with different access patterns.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github