2 ms·
> 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 ent
by 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.