3 ms·
You did manage to remove data dependant branch (which indeed should improve performance), but I guess the dependency chain it created was too long. It might ev
by vardump 8y ago
You did manage to remove data dependant branch (which indeed should improve performance), but I guess the dependency chain it created was too long.
It might even be a dependency through "dst" value. CPU reorder buffers are nowadays long, ~200 instructions, so not knowing where to write on the next loop iteration might be stall the core. Didn't have time to analyze this very deeply.
Then again, not knowing (or more like only conditionally data dependant known, with a dependency to previous iteration) where to write on next round is a pretty fundamental problem when you want to remove chars from string.
- lostmsu 8y agoPerhaps branch prediction works better with jumps than CMOV. Or maybe it has something to do with HT (if it is on).