No Branch
for (auto i = 0u; i < arr.size(); ++i) {
if (arr[i] > 128)
sum += arr[i];
}
for (auto i = 0u; i < arr.size(); ++i) {
sum += arr[i] * (arr[i] > 128);
}
* The benchmark is run under Apple Macbook Air M2.
* For the full benchmark code, please refer here.