range based for-loops may be syntax sugar but they help get the performance:
const auto end_ = a_container.end(); for (auto i = a_container.begin(); i != end_; ++i) { ... }
vs
for (auto i = a_container.begin(); i != a_container.end(); ++i) { ... } //reevaluate end() for each iteration