News for hackers. Stuff that matters.
Re:Decreasing the Number of Memory Accesses 1/2 by hamilyon2 on Friday March 31, 2023 @07:23AM (#35385363)
The article is about the same thing essentially? Decreasing number of memory accesses is the same thing as exploiting cache locality. Registers are the just more local more high-speed level of cache. Given on modern superscalar CPUs registers are virtual anyway.
Re:Decreasing the Number of Memory Accesses 1/2 by twawaaay on Friday March 31, 2023 @08:02AM (#35385747)
> The article is about the same thing essentially? Decreasing number of memory accesses is the same thing as exploiting cache locality.

No, it is not. For example, you can have an application that is doing a lot of memory accesses, but the working set is controlled to fit the cache except for couple of things that need to be fetched into the cache but you make sure those things fit predictable pattern that the CPU prefetcher can recognise and supply in advance of you needing it.

Now, having less memory accesses usually helps, but it is kinda newb way of looking at the problem. What if you have to make a lot of accesses because your application is memory heavy (say it is a database)? Does it mean there is nothing you can do to improve it? Of course there are things you can do to improve it -- but you need a bit more in depth knowledge.

Re:Decreasing the Number of Memory Accesses 1/2 by mackman on Friday March 31, 2023 @08:12AM (#35385870)
I think this article is about cache locality, but temporal cache locality. Which is just as important albeit orthogonal to what you are describing.