Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions content/english/hpc/cpu-cache/associativity.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ weight: 11
Consider a [strided incrementing loop](../cache-lines) over an array of size $N=2^{21}$ with a fixed step size of 256:

```cpp
for (int i = 0; i < N; i += 256)
a[i]++;
for (int j = 0; j < K; j++)
for (int i = 0; i < N; i += 256)
a[i]++;
```

And then this one, with the step size of 257:

```cpp
for (int i = 0; i < N; i += 257)
a[i]++;
for (int j = 0; j < K; j++)
for (int i = 0; i < N; i += 257)
a[i]++;
```

Which one will be faster to finish? There are several considerations that come to mind:
Expand Down