Performance optimisation is very counterintuitive. That's why you need to measure first.
One data structure may be faster than another in theory, but due to CPU cache, slower in practice
The compiler will also do a lot of work to help your code be faster.

Don't go with intuition. Measure.

Comments