Files

5 lines
1.4 KiB
HTML

<!doctype html><html lang="en"><meta charset="utf-8"><title>Caches, locality, and working sets</title><h1>Caches, locality, and working sets</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Locality describes reuse of nearby data or recently accessed data. A working set that fits a cache can behave differently from one that streams through RAM. Stride, element size, prefetching, compiler optimization, and the amount of useful work all affect results. A Python loop also measures interpreter overhead, so it cannot isolate cache latency by itself.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">data=list(range(16))
print(sum(data))
print(sum(data[::4]))
</code></pre><p><strong>Expected result:</strong> <code>120
24</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_agx">Language reference: git.agilaos.com</a></p><p><a href="https://docs.nvidia.com/cuda/cuda-c-best-practices-guide/">Language reference: docs.nvidia.com</a></p></html>