Why is the float * int multiplication faster than int * float in CPython?
Why is the float * int multiplication faster than int * float in CPython? Question: Basically, the expression 0.4 * a is consistently, and surprisingly, significantly faster than a * 0.4. a being an integer. And I have no idea why. I speculated that it is a case of a LOAD_CONST LOAD_FAST bytecode pair being …