3 ms·
Won'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
by repsilat 16y ago
Won'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.