4 ms·
I'm no compiler expert, but I would expect that compilers would put exception-handling code on a separate 64-byte cache line. You only use up "cache" if you ac
by dragontamer 7y ago
I'm no compiler expert, but I would expect that compilers would put exception-handling code on a separate 64-byte cache line.
You only use up "cache" if you actually hit the cache. If you're on a different L1 cache line (and never execute), you'll never be in L1 instruction cache, maybe never even in L2 or even L3 cache lines.
Not that I'm an expert on compilers... but whenever I look at assembly, there are lots of "NOPs" across the code. I've always assumed it was for some kind of boundary alignment, probably cache.
- vardump 7y ago> I'm no compiler expert, but I would expect that compilers would put exception-handling code on a separate 64-byte cache line. I'd sure hope they're on an entirely different page, not just cache line! Concerning compiler code alignment: they seem to place my code on 16-byte boundaries - for a good reason too, the smallest code size while keeping optimal 16-byte aligned branch targets. In past I actually had to drop to assembler to get 64-byte (cache line) alignment for functions (MSVC). GCC does have optimize pragma, like: #pragma GCC optimize ("align-functions=64") Although I want to point out one shouldn't usually worry about low level details like function alignment. Use profile guided optimization, etc. instead. Also remember due to L1 set associativity limitations excessive alignment can even cause pathological L1 churn in the worst case.