2 ms·
Fast code doesn't touch memory that often - if you're doing enough loads/stores that the extra instruction is significant, you're probably bounded by memory lat
by jbri 16y ago
Fast code doesn't touch memory that often - if you're doing enough loads/stores that the extra instruction is significant, you're probably bounded by memory latency instead of processor speed anyway.
And the most common "frequent" accesses (stack space) don't require those checks.
- repsilat 16y agoWon't iterating over a heap-allocated array result in a load for every element? A lot of good C will keep a lot in L1, but it won't always be in registers or on the stack.
- jbri 16y agoYes, there you'll be incurring the huge performance penalty of one additional instruction per element in the array. As I said, not really significant unless your loop is so tight that memory latency is the big limiter anyway.