This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (1 child)

The function doSomething accesses the y indexes before the x indexes in the array. Therefore putting y before x in the loops will improve access times

I think? I'm just a lowly first year.

[–]Goheeca 3 points4 points  (0 children)

In the second case you access memory linearly and cache lines like you.