3 ms·
But some of the processor's cache is devoted to storing code. The original loop constantly switched the feature being compared. Since the different features (pr
by newt0311 18y ago
But some of the processor's cache is devoted to storing code. The original loop constantly switched the feature being compared. Since the different features (presumably) used significantly different code, the processor would end up with unnecessarily large number of cache flushes for code. By aggregating the features one by one, he reduced code-cache flow significantly which makes a big difference in performance. Much bigger than some people realize.
- malkia 18y agoUsually that's a different cache, but even if it's the same, the code is usually smaller. But you bring a good point - for example on certain platforms (certain game consoles for example), where memory, and cache miss is expensive, often compiling with -O1 rather than -O2 (inline expansion) is better.