Jump to content
  • Advertisement
Sign in to follow this  
noNchaoTic

ASM vs. C++

This topic is 4854 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im currently (when I have time) dabbling with some inline assembly. I was just wondering what are the best ways to see how much of a speed boost I am getting with what im writing with ASM? For instance i wrote a factorial function in C++ and then one in ASM whats the best way to compare the 2? Another thing I was wondering is, is it ok to use inline assembly for templatized classes? Say for instance I had a cVector3<Number> class, can i then write ASM code for all the methods inside the class without worrying about the various types that the template class could be used for? Cheers in advance, :)

Share this post


Link to post
Share on other sites
Advertisement
jan wrote a nice overview article on timing here :
Timing Pitfalls and Solutions

Quote:

can i then write ASM code for all the methods inside the class without worrying about the various types that the template class could be used for

depends. probably not.

Share this post


Link to post
Share on other sites
For 99.9% of what you are doing, I am going to guess that ASM won't help considerably.

A good way to compare is to set up a loop performing each of the function x numvber of times. Ideally you want it to last a few seconds to get some good seperation if they are pretty close, maybe 10 to be safe.

You can start a timer right before the loop calling the c++ function and se how long it takes to complete. Then start the timer again to see how long it takes to loop through the ASM code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!