But in all seriousness, the only way to "optimize" that code is to properly indent it so that it is more readable. There's absolutely no point in pondering about pipelining when you have IO all over the place.
–
MysticialJan 11 '13 at 6:16

1

Your code performs two memset-like operations for vectors, so why not code it as such?
–
Aki SuihkonenJan 11 '13 at 6:40

1 Answer
1

If, for whatever reason, your compiler cannot be trusted to exhibit basic optimization competence, and the code it generates runs with lower performance than you were expecting based on machine limits (you're measuring performance, and you know those limits, right?), then you can start optimizing manually: