Archived

This topic is now archived and is closed to further replies.

Happy Thoughts

Programming optimizations

Recommended Posts

Does any body know what generates the fastest code in visual C++ 6.0 When you are optimizing a game so you use a vector classes or vector structs or can you program C++ classes to get the same speed as structs with inline functions. Any help on this topic would be great!

Share this post


Link to post
Share on other sites
i personally prefer vector classes implemented with C++.

i´ve noticed no performance drawbacks. try to avoid virtual methods that are called thousands or hundred thousands of times each frame.

and you should also avoid overloaded operators that return class structs.

use "call by reference" paramters whenever possible

Share this post


Link to post
Share on other sites
If you are targeting windows, save yourself a bunch of time and use the D3DX math lib that comes with DirectX 8.1. You can link in the math library without the rest of DX, and it has lots of matrix, vector and quaternion functions and associated overloaded operators. All the functions are also SIMD accelerated for both Intel and AMD processors.

Share this post


Link to post
Share on other sites