@lysdexic to ProgrammingEnglish • 7 months agoPush Ifs Up And Fors Downmatklad.github.iomessage-square22arrow-up156arrow-down16
arrow-up150arrow-down1external-linkPush Ifs Up And Fors Downmatklad.github.io@lysdexic to ProgrammingEnglish • 7 months agomessage-square22
minus-square@[email protected]linkfedilink1•7 months agoYou still need to read the variable in each iteration, but the cost of that is probably negligible
minus-squareRyanlinkEnglish4•edit-27 months agoModern optimizing compilers are magical. I would need to check assembly but I would actually expect the if to be hoisted out of the loop entirely to relieve pressure on the branch predictor.
You still need to read the variable in each iteration, but the cost of that is probably negligible
Modern optimizing compilers are magical. I would need to check assembly but I would actually expect the if to be hoisted out of the loop entirely to relieve pressure on the branch predictor.