News for hackers. Stuff that matters.
Re:Writing memory efficient C structs by voidnap on Thursday July 31, 2025 @02:23AM (#44742897)
> memory is cheap and plentiful. What's expensive is CPU cache.

CPU cache is memory. Also memory isn't cheap, it is relatively expensive to access. CPU cache is way cheaper. You have it backwards.

Re:Writing memory efficient C structs by writebetterc on Thursday July 31, 2025 @05:21AM (#44743863)
They're talking about dollars
Re:Writing memory efficient C structs by mort96 on Thursday July 31, 2025 @07:24AM (#44744484)
The obvious and charitable read of their post is that they use "memory" to mean main memory/RAM, "CPU cache" to mean CPU cache, and "memory is cheap and plentiful" to mean "memory has a low dollar cost and most systems have a whole lot of it".

Your read -- that they use "memory" to mean "anything which stores bytes, including caches", and that they use "memory is cheap" to mean "accessing RAM has a low latency" -- is uncharitable, contrived and even literally self-contradictory ("CPU cache is memory" + "memory is expensive to access while CPU cache is cheap to access" is a contradiction which can only be resolved through using different definitions of "memory" in those two sentences).