How much faster is multiplication than division?(swortham.blogspot.com)

submitted by BucketSoftBucketSoft(324) 7 months, 22 days ago

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.

1 comment |category: |Views: 50

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by dpetersondpeterson(4397) 7 months, 21 days ago 0

I think many other compilers and interpreters suffer this same problem. Some more advanced VM's get closer to speed parity (division in LuaJIT supposedly only lags 5% behind multiplication).
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.

Reply

information Login or create an account to comment on this story