255 Views
This is one of those things I learned a long time ago when I used to write a lot of animations, games, etc -- multiplication is faster than division. But I can't remember ever testing this to see exactly how much of a performance gap there was. I figured division might be 2 or 3 times slower. In fact, the difference is much greater than that.
I'm not an expert on the internals of Intel or AMD processors, and I'm not sure what's going on under the hood in the CLR, but generally division is handled as repeated subtraction. I think the repeated subtraction is what makes it more costly but I'm not sure as to the technical reasons why.