Hacker News new | ask | show | jobs
by FreezerburnV 4242 days ago
Out of curiosity, what kind of impact does having executables with so much zero-padding have on code being cached into the L1/L2/LN caches of a CPU? Sure it might be more efficient to load sections of an executable into memory from the file system due to alignment, but does the inflated size cause code to get booted out of a cache more often, or does it not really have any effect? We might have nigh infinite amounts of cheap storage these days, but that still doesn't hold true for the small caches next to the CPU where things run truly fast, and not just adequately fast.
1 comments

It has almost no one effect on L1/L2 cache usage. CPU caches tend to work on 64-128 byte cache lines. Most of the lines in s mostly zero page will never get touched so they will never enter the cache.